CharacterArray extend [
     asArrayOfSubstrings [
     <category: 'converting'>
        | first last collection |
        
        collection := OrderedCollection new.
        last := 0.
        [first := self findFirst: [ :char | char isSeparator not] startingAt:
last + 1. first ~= 0]
                whileTrue:
                        [last := (self findFirst: [ :char | char isSeparator] 
startingAt:
first) - 1.
                        last<  0 ifTrue: [last := self size].
                        collection add: (self copyFrom: first to: last)].
        ^collection asArray

Missing closing bracket here:

    ]
]

Paolo


_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to