CHANGE
Returns string, with up to count occurrences of the substring old changed to the substring new. The default value for count is 1. If you specify count, it must be zero or a positive whole number. If you specify zero, all occurrences of old in string are changed to new.
You can restrict the byte positions within string that are examined for substring old by specifying a starting byte position (start) and a length in bytes (length). The default value for start is 1. If you specify start, it must be a positive whole number. If start is greater than LENGTH(string), the CHANGE function has no effect. If you specify length, it must be zero or a positive whole number. If you omit length, or specify zero, the remainder of string from byte position start is examined. If length is less than LENGTH(old), the CHANGE function has no effect.
The lengths of substrings old and new can be different. If you omit old, the substring new is inserted in string at the byte position indicated by start. If you omit new, the substring old is deleted from string.
Here are some examples:
CHANGE('abcabcabc','abc','DeF') ⟶ 'DeFabcabc'
/* 1 (default) occurrence of old changed */
CH('abcabcabc','abc','DeF',2) ⟶ 'DeFDeFabc'
/* 2 occurrences of old changed */
CHANGE('abcabcabc','abc','DeF',0) ⟶ 'DeFDeFDeF'
/* count = 0, all occurrences of old changed */
CH('abcabcabc','abc','DeF',,4) ⟶ 'abcDeFabc'
/* 1 (default) occurrences of old changed, */
/* starting at position 4 */
CHANGE('aaaaaaaa','a',A',0,3,2) ⟶ 'aaAAaaaa'
/* all occurrences of old changed, starting at */
/* position 3 for a length of 2 */
CH('abcabcabc','a',,0) ⟶ 'bcbcbc'
/* new omitted, count = 0, */
/* all occurrences of old deleted */
CHANGE('abc',,'def',,2) ⟶ 'adefbc'
/* old omitted, new inserted, starting at */
/* position 2 */