substitute_all_string 函数
替换子串的每次出现。
语法
StringTools:-SubstituteAll(text, old, new)substitute_all_string(text, old, new)
参数与选项
text | 文本值,通常写在引号中。 |
|---|---|
old | 要替换的子串。 |
new | 替换后的文本。 |
示例
- 全部替换
StringTools:-SubstituteAll('a-b-a', 'a', 'x')返回 x-b-x。
替换子串的每次出现。
StringTools:-SubstituteAll(text, old, new)substitute_all_string(text, old, new)text | 文本值,通常写在引号中。 |
|---|---|
old | 要替换的子串。 |
new | 替换后的文本。 |
StringTools:-SubstituteAll('a-b-a', 'a', 'x')返回 x-b-x。