活动
最新
False
横幅背景图像
工作流活动
上次更新日期 2024年4月22日

替换

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

定义

命名空间: 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
)
input 字符串
要替换的字符串。
pattern 字符串
要匹配的正则表达式模式。
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
)
input 字符串
要替换的字符串。
pattern 字符串
要匹配的正则表达式模式。
replacement 字符串
替换字符串。
regexOption 正则表达式选项
枚举值的按位组合,用于指定匹配选项。 可用选项为 IgnoreCaseMultilineExplicitCaptureCompiledSingelineIgnorePatternWhitespaceRightToLeftECMAScriptCultureInvariant

返回值

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

此页面是否有帮助?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath 白色徽标
信任与安全
© 2005-2024 UiPath. All rights reserved.