The original text string.
The text string to be replaced.
The replacement text.
A number which specifies which occurrence of the second parameter to replace (counting from the left). If omitted, 1 is assumed.
The resulting text string.
Substitutes new text for old text in a text string and returns it. SUBSTITUTE("abc def", "def", "xyz")SUBSTITUTE("abc def"; "def"; "xyz") returns "abc xyz", a version of the first parameter where all occurrences of the second parameter, "def", have been replaced by the third parameter, "xyz".
Use REPLACE to replace text where the position of the text to be replaced is known. Use REGEXREPLACE to replace text using powerful regular expressions which find the text to replace.
Returns "abc xyz".
Returns "abc xyz". The regular expression "d\w\w" matches a literal "d", followed by exactly two letters, thereby matching "def".