# HG changeset patch # User Claus Gittinger # Date 1403516478 -7200 # Node ID fceeb99e31dfe5053841cd880e86059fb1116ac2 # Parent 31c545ff56eca1fa368f3ff2847618254a948c0c class: SequenceableCollection added: #upToSeparator diff -r 31c545ff56ec -r fceeb99e31df SequenceableCollection.st --- a/SequenceableCollection.st Mon Jun 23 11:38:58 2014 +0200 +++ b/SequenceableCollection.st Mon Jun 23 11:41:18 2014 +0200 @@ -4754,6 +4754,20 @@ " ! +upToSeparator + "Return the next elements up to but not including the next separator. + The next read will return the separator. + If no separator is encountered, the contents up to the end is returned. + The elements are supposed to understand #isSeparator + (i.e. the receiver is supposed to be a character-stream)." + + ^ self upToElementForWhich:[:ch | ch isSeparator] + + " + 'hello world' upToSeparator + " +! + withoutLeadingForWhich:aCheckBlock "return a copy of myself without leading elements for which aCheckBlock returns true. Returns an empty collection, if the receiver consist only of matching elements. @@ -9747,11 +9761,11 @@ !SequenceableCollection class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libbasic/SequenceableCollection.st,v 1.382 2014-06-23 09:38:04 cg Exp $' + ^ '$Header: /cvs/stx/stx/libbasic/SequenceableCollection.st,v 1.383 2014-06-23 09:41:18 cg Exp $' ! version_CVS - ^ '$Header: /cvs/stx/stx/libbasic/SequenceableCollection.st,v 1.382 2014-06-23 09:38:04 cg Exp $' + ^ '$Header: /cvs/stx/stx/libbasic/SequenceableCollection.st,v 1.383 2014-06-23 09:41:18 cg Exp $' ! !