StringReplace

WMA link


StringReplace["string“, ”a"->"b"]

replaces each occurrence of old with new in string.

StringReplace["string", {"$s_1$"->"$sp_1$“, ”$s_2$"->"$sp_2$"}]

performs multiple replacements of each si by the
corresponding spi in string.

StringReplace["string", srules, n]

only performs the first n replacements.

StringReplace[{"$string_1$“, ”$string_2$", ...}, srules]

performs the replacements specified by srules on a list
of strings.

StringReplace replaces all occurrences of one substring with another:

Multiple replacements can be supplied:

Only replace the first 2 occurrences:

Also works for multiple rules:

StringReplace acts on lists of strings too:

StringReplace also can be used as an operator:

StringPosition
StringReverse