On 2013-02-19, at 17:15, James Foster <Smalltalk@JGFoster.net> wrote:
On Feb 19, 2013, at 7:32 AM, Camillo Bruni <camillobruni@gmail.com> wrote:
';;;;' splitOn: $;
And your point is? I'm afraid I'm not able to interpret your message. What does an array of one or five empty strings mean? A terse reply like this suggests either an email error with an incomplete message or that you think that the information provided is so obvious that there is only one way to interpret your message. If you think that the current implementation is useful, I'd be interested in reading a realistic use case.
Apparently you like to write a lot, I don't.. so in verbose plain english: Q: "Shouldn't there be some kind of alternative which would yield?" A: Yes there is, use #splitOn: Example: -------- '1;;2;3;4' splitOn: $; yields: an OrderedCollection('1' '' '2' '3' '4') Reduced Example: ---------------- ';;;;' subStrings: ';' ===> #() ';;;;' splitOn: $; ===> an OrderedCollection('' '' '' '' '')
On 2013-02-19, at 16:30, Friedrich Dominicus <frido@q-software-solutions.de> wrote:
I do not know if that is standardized. But the current behavior of subStrings is that something like: '1;;2;3;4' subStrings: ';'
yields: #('1' '2' '3' '4')
that means the array may get longer or shorter with the same number of separators.
Shouldn't there be some kind of alternative which would yield? #('1' '' '2' '3' '4')
Maybe there is a reason for the first decision. If not what would be the problem with having it both ways?