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.
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?
Yes, you are quite right. Imagine that you were dealing with data structures represented by a delimited string (e.g., HL7 has been in use since 1987), where the interpretation of a field is based on its position. In this case allowing empty fields is completely reasonable and, in fact, necessary to proper interpretation of the data. Shifting all the fields because one field happens to be empty is just wrong. James Foster