MathTop

substitute_all_string 函数

替换子串的每次出现。

语法

  • StringTools:-SubstituteAll(text, old, new)
  • substitute_all_string(text, old, new)

参数与选项

text文本值,通常写在引号中。
old要替换的子串。
new替换后的文本。

示例

  1. 全部替换StringTools:-SubstituteAll('a-b-a', 'a', 'x')返回 x-b-x。