substitute ( text ; searchString ; replaceString ) This function replaces the “search-sting” by specific “replace-string” in your text.
If you have colors as “Red” & ¶ & “Green” & ¶ & “Blue” & ¶ & “Yellow” and you want to replace the text “Red” as “R” then the syntax will be
substitute (“Red” & ¶ & “Green” & ¶ & “Blue” & ¶ & “Yellow” ; “Red” ; “R” )
or
Let ( colors = “Red” & ¶ & “Green” & ¶ & “Blue” & ¶ & “Yellow” ; Substitute ( colors ; “Red” ; “R” ))
For multiple substitute if you have colors as “Red” & ¶ & “Green” & ¶ & “Blue” & ¶ & “Yellow” and you want to replace “Red” as “R”, “Green” as “G”, “Blue” as “B”, and “Yellow” as “Y” in a single calculation follow the below method.
Let ( colors = “Red” & ¶ & “Green” & ¶ & “Blue” & ¶ & “Yellow” ; Substitute ( colors ; [“Red” ; “R”]; [ “Green”;”G”]; [“Blue”;”B”]; [“Yellow”;”Y”] ))
In the substitute function the string inside the [“”; “”] is treated as one condition,you can add multiple conditions separated by semicolon “;” as [“”; “”]; [“”; “”]; [“”; “”]