parse-replace: func [
{Replaces the search value with the replace value within the target series.}
target [series!] "Series that is being modified."
search "Value to be replaced."
replace "Value to replace with."
/all "Replace all occurrences."
/case "Case-sensitive replacement."
/local len skip-len rule text
][
len: length? form search
skip-len: length? form replace
rule: copy [
[to search mark: (change/part mark replace len) skip-len skip]
to end
]
if all [insert rule 'any]
either case [parse/all/case target rule] [parse/all target rule]
target
]
You need to create an account or log in to post comments to this site.