'From Squeak3.7alpha of 11 September 2003 [latest update: #5707] on 23 February 2004 at 10:19:07 pm'! "Change Set: beginsEndsWith-bp Date: 21 February 2004 Author: Bernhard Pieber Implements beginsWith: and endsWith: for all SequenceableCollections, not only for Strings."! !SequenceableCollection methodsFor: 'testing' stamp: 'bp 2/23/2004 21:47'! beginsWith: aSequenceableCollection (aSequenceableCollection isEmpty or: [self size < aSequenceableCollection size]) ifTrue: [^false]. aSequenceableCollection withIndexDo: [:each :index | (self at: index) ~= each ifTrue: [^false]]. ^true! ! !SequenceableCollection methodsFor: 'testing' stamp: 'bp 2/23/2004 21:48'! endsWith: aSequenceableCollection | start | (aSequenceableCollection isEmpty or: [self size < aSequenceableCollection size]) ifTrue: [^false]. start _ self size - aSequenceableCollection size. aSequenceableCollection withIndexDo: [:each :index | (self at: start + index) ~= each ifTrue: [^false]]. ^true! !