drop
Returns a sequence containing all elements except first n elements.
The operation is intermediate and stateless.
Samples
import samples.*
import kotlin.test.*
fun main() {
//sampleStart
val chars = ('a'..'z').toList()
assertPrints(chars.drop(23), "[x, y, z]")
assertPrints(chars.dropLast(23), "[a, b, c]")
assertPrints(chars.dropWhile { it < 'x' }, "[x, y, z]")
assertPrints(chars.dropLastWhile { it > 'c' }, "[a, b, c]")
//sampleEnd
}
Throws
if n is negative.