CHANGE(), SWAP() |
![]() ![]() ![]() |
The CHANGE() function replaces occurrences of a substring within a string by another substring. The synonym SWAP() can be used.
Format
CHANGE(string, old, new{, occurrence{, start}})
where
The CHANGE() function replaces the specified occurrences of old within string by new.
If old is a null string, the function returns string unchanged. If new is a null string, all occurrences of old are removed.
If the $NOCASE.STRINGS compiler directive is used, matching of old against string is case insensitive.
Examples
PRINT CHANGE("ABRACADABRA", "A", "a", 3, 2)
This statement results in printing the string "ABRaCaDaBRA".
See also: |