activities
latest
false
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。
UiPath logo, featuring letters U and I in white

工作流活动

上次更新日期 2025年9月15日

替换

在指定的输入字符串中,将正则表达式模式的匹配字符串替换为指定的替换字符串。

定义

命名空间: UiPath Activities.System.API

程序集: UiPath.System.Activities.Api(在 UiPath.System.Activities.Api.dll 中)

重载

  
Replace(String, String, String)在指定的输入字符串中,将正则表达式模式的匹配字符串替换为指定的替换字符串。
Replace(String, String, String, Regex Options)在指定的输入字符串中,将与正则表达式模式和正则表达式选项匹配的字符串替换为指定的替换字符串。

Replace(String, String, String)

在指定的输入字符串中,将正则表达式模式的匹配字符串替换为指定的替换字符串。

string Replace(
	string input,
	string pattern,
	string replacement
)string Replace(
	string input,
	string pattern,
	string replacement
)
输入 字符串
要替换的字符串。
模式 字符串
要匹配的正则表达式模式。
替换 字符串
替换字符串。

Replace(String, String, String, Regex Options)

在指定的输入字符串中,将与正则表达式模式和正则表达式选项匹配的字符串替换为指定的替换字符串。

string Replace(
	string input,
	string pattern,
	string replacement,
	RegexOptions regexOption
)string Replace(
	string input,
	string pattern,
	string replacement,
	RegexOptions regexOption
)
输入 字符串
要替换的字符串。
模式 字符串
要匹配的正则表达式模式。
替换 字符串
替换字符串。
正则表达式选项 正则表达式选项
枚举值的按位组合,用于指定匹配选项。 可用选项为 IgnoreCaseMultilineExplicitCaptureCompiledSingelineIgnorePatternWhitespaceRightToLeftECMAScriptCultureInvariant

返回值

与输入字符串相同的新字符串,但替换字符串将替代每个匹配的字符串。

此页面有帮助吗?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath Logo
信任与安全
© 2005-2025 UiPath。保留所有权利。