abstractdeftake(n: Int): Repr Selects first n elements.
Note: might return different results for different runs, unless the underlying collection typeisordered. n the number of elements to take from this general collection. returns a general collection consisting only of the first n elements of this general collection, or else the whole general collection, if it has less than n elements. If n is negative, returns an empty general collection.
abstractdefdrop(n: Int): Repr Selects all elements except first n ones.
Note: might return different results for different runs, unless the underlying collection typeisordered. n the number of elements to drop from this general collection. returns a general collection consisting of all elements of this general collection except the first n ones, or else the empty general collection, ifthis general collection has less than n elements. If n is negative, don't drop any elements.
deftakeRight(n: Int): Repr Selects last n elements. n the number of elements to take returns a sequence consisting only of the last n elements of this sequence, or else the whole sequence, if it has less than n elements. DefinitionClasses IndexedSeqOptimized → IterableLike
defdropRight(n: Int): Repr Selects all elements except last n ones. n The number of elements to take returns a sequence consisting of all elements of this sequence except the last n ones, or else the empty sequence, ifthis sequence has less than n elements. DefinitionClasses IndexedSeqOptimized → IterableLike
defsubstring(start: Int, end: Int): String Returns a newString made up of a subsequence of this sequence, beginning at the start index (inclusive) and extending to the end index (exclusive).
target.substring(start, end) is equivalent to target.slice(start, end).mkString start The beginning index, inclusive. end The ending index, exclusive. returns ThenewString. Exceptions thrown StringIndexOutOfBoundsExceptionIf either index is out of bounds, or if start > end.