本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
Replace
replace 将字符串的一部分替换为您指定的其他字符串。
语法
replace(expression,substring,replacement)
Arguments
- expression
-
表达式必须是字符串。它可以是使用字符串数据类型的字段的名称、文本值(如
'12 Main Street')或对输出字符串的其他函数的调用。 - substring
-
expression 中您要替换的一组字符。子字符串可在 expression 中出现一次或多次。
- replacement
-
您要用来替换 substring 的字符串。
返回类型
字符串
示例
以下示例将子字符串“and”替换为“or”。
replace('1 and 2 and 3', 'and', 'or')
返回以下字符串。
1 or 2 or 3