15.9.10 replace(string, match, replacement)

Replaces all match characters in a string with replacement characters. The first input argument is the string and is of the data type text. The second argument is the match and is of the data type text. The third argument is replacement and is of data type text. The returned value is a text in which the third string argument (replacement) replaces the second string argument (match).

If match is not found in the string, then the original string will be returned.

Examples

Function Result

replace(“aabbccdd”,”cc”,”ff”)

aabbffdd

replace(“aabbcccdd”,”cc”,”ff”)

aabbffcdd

replace(“aabbddee”,”cc”,”ff”)

aabbddee