Top  Previous  Next


The SUBSTITUTE() function performs substring replacement on successive elements of a dynamic array, returning a similarly structured dynamic array of results.





SUBSTITUTE(dyn.array, old.list, new.list {, delimiter})




dyn.arrayis the dynamic array to be processed.


old.listis list of items to replace.


new.listis list of replacement items.


delimiteris the single character delimiter separating items in old.list and new.list. If omitted, this defaults to a value mark.



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.





A contains  DFMDVMFVMP


B = SUBSTITUTE(A, 'D|P', 'Done|Pending', '|')


B will contain DoneFMDoneVMFVMPending