REPLACE
Replaces all occurrences of a specified search string with a replacement string
Description
The REPLACE()
function is used to replace all occurrences of a specified search string with a replacement string within a given text. It's a versatile tool for text manipulation and data cleaning.
Syntax
REPLACE(text, search
, replace
)
text
: The input text string in which you want to perform replacements.search
: The text you want to find and replace.replace
: The text with which you want to replace the found search string.
Example
Table
ID
Text
1
Huge SALE on electronics today!
2
Special SALE: Save 20% on select items.
3
No SALE available for this product.
Function
REPLACE(`Text`, "SALE", "DISCOUNT")
Results
REPLACE (text)
Huge DISCOUNT on electronics today!
Special DISCOUNT: Save 20% on select items.
No DISCOUNT available for this product.
Last updated