Closed rlwhitcomb closed 11 months ago
The syntax that works the best is to require the extra comma if the replacement value is missing and the mode is used, as in:
replace 'abcabc', 'b', , first -> "acabc"
replace 'abcabc', 'b' -> "acac"
Worse problem is the ambiguity when doing:
replace(read(file), 'a', 'b')
where the "read" greedily takes two params, leaving two for "replace", when it should be "read" has one, and "replace" has three.
... meaning to remove it, as in:
This is more complicated syntax because there is also the optional mode parameter.