Skip to main content

StringReplace

StringReplace["string",s->sp] replaces the string expression s by sp wherever it appears in "string". 

StringReplace["string",{s1->sp1,s2->sp2,…}] replaces the string expressions si by spi whenever they appear as substrings of "string".

StringReplace["string",srules,n] does only the first n replacements.

StringReplace[{s1,s2,…},srules] gives the list of results for each of the si.

StringReplace[srules] represents an operator form of StringReplace that can be applied to an expression.

Please visit the official Wolfram Language Reference for more details and examples on core symbols.