REPLACE() replaces each occurrence of the search string in the input string with the corresponding replace string. This function is case sensitive, meaning it will only match and replace exact character sequences.
REPLACE(string, search string, replace string)
REPLACE() returns a character string
// Replacing words
REPLACE("APPLES AND ORANGES", "ORANGES", "APPLES") = "APPLES AND APPLES"
REPLACE("APPLES AND ORANGES", "APPLES", "ORANGES") = "ORANGES AND ORANGES"
// Replacing substrings
REPLACE("APPLES AND ORANGES", "ES", "E") = "APPLE AND ORANGE"
// Case sensitivity examples
REPLACE("Apples and Oranges", "apples", "Pears") = "Apples and Oranges" // No match due to case
REPLACE("Apples and Oranges", "Apples", "Pears") = "Pears and Oranges" // Exact match