Hello guys, I just encounter these methods and got a bit disappointed
First there is
SequenceableCollection>>#replaceAll: oldObject with: newObject
"Replace all occurences of oldObject with newObject"
On String it something like:
string := 'lapin'.
string replaceAll: $a with: $b
so now string is 'lbpin'
Looking for a non destructive version, I looked at: #copyReplaceAll:with:
SequenceableCollection>>#copyReplaceAll: oldSubstring with: newSubstring
"Default is not to do token matching.
See also String copyReplaceTokens:with:"
So here it's not destructive, but
1) The argument names are wrong (or the method is not defined on the correct
class)
2) why one take an element as argument and the other one a collection of
elements ?
Am I the only one disturb by this ?
Ben