Next: , Previous: , Up: SequenceableCollection   [Index]


1.151.5 SequenceableCollection: copying SequenceableCollections

copyAfter: anObject

Answer a new collection holding all the elements of the receiver after the first occurrence of anObject, up to the last.

copyAfterLast: anObject

Answer a new collection holding all the elements of the receiver after the last occurrence of anObject, up to the last.

copyFrom: start

Answer a new collection containing all the items in the receiver from the start-th.

copyFrom: start to: stop

Answer a new collection containing all the items in the receiver from the start-th and to the stop-th

copyReplaceAll: oldSubCollection with: newSubCollection

Answer a new collection in which all the sequences matching oldSubCollection are replaced with newSubCollection

copyReplaceFrom: start to: stop with: replacementCollection

Answer a new collection of the same class as the receiver that contains the same elements as the receiver, in the same order, except for elements from index ‘start’ to index ‘stop’.

If start < stop, these are replaced by the contents of the replacementCollection. Instead, If start = (stop + 1), like in ‘copyReplaceFrom: 4 to: 3 with: anArray’, then every element of the receiver will be present in the answered copy; the operation will be an append if stop is equal to the size of the receiver or, if it is not, an insert before index ‘start’.

copyReplaceFrom: start to: stop withObject: anObject

Answer a new collection of the same class as the receiver that contains the same elements as the receiver, in the same order, except for elements from index ‘start’ to index ‘stop’.

If start < stop, these are replaced by stop-start+1 copies of anObject. Instead, If start = (stop + 1), then every element of the receiver will be present in the answered copy; the operation will be an append if stop is equal to the size of the receiver or, if it is not, an insert before index ‘start’.

copyUpTo: anObject

Answer a new collection holding all the elements of the receiver from the first up to the first occurrence of anObject, excluded.

copyUpToLast: anObject

Answer a new collection holding all the elements of the receiver from the first up to the last occurrence of anObject, excluded.

copyWithFirst: anObject

Answer a new collection holding all the elements of the receiver after the first occurrence of anObject, up to the last.


Next: , Previous: , Up: SequenceableCollection   [Index]