Skip to content

StringReplace

StringReplace[str, before->after] replaces any occurrence of before with after in str.

Attributes[StringReplace] := {Protected}

Simple examples

In[1]:= StringReplace["hello world", "world" -> "foo"]
Out[1]= "hello foo"