SUBSTITUTE() |
![]() ![]() ![]() |
The SUBSTITUTE() function performs substring replacement on successive elements of a dynamic array, returning a similarly structured dynamic array of results.
Format
SUBSTITUTE(dyn.array, old.list, new.list {, delimiter})
where
The SUBSTITUTE() function processes each element of dynamic array dyn.array constructing an equivalently structured new dynamic array result. Where an element of dyn.array contains a value in the old.list, the result contains the corresponding item from new.list. Where there is no match with an item in old.list, the source data is copied to the result dynamic array.
Although this function is defined to operate on dynamic array, it may be equally useful when dyn.array is a simple single valued string.
Example
A contains DFMDVMFVMP
B = SUBSTITUTE(A, 'D|P', 'Done|Pending', '|')
B will contain DoneFMDoneVMFVMPending |