dropWhile
@ExperimentalUnsignedTypes inline fun ULongArray.dropWhile(
predicate: (ULong) -> Boolean
): List<ULong>
(source)
@ExperimentalUnsignedTypes inline fun UByteArray.dropWhile(
predicate: (UByte) -> Boolean
): List<UByte>
(source)
@ExperimentalUnsignedTypes inline fun UShortArray.dropWhile(
predicate: (UShort) -> Boolean
): List<UShort>
(source)
Returns a list containing all elements except first elements that satisfy the given predicate.
import kotlin.test.*
fun main(args: Array<String>) {
//sampleStart
val chars = ('a'..'z').toList()
println(chars.drop(23)) // [x, y, z]
println(chars.dropLast(23)) // [a, b, c]
println(chars.dropWhile { it < 'x' }) // [x, y, z]
println(chars.dropLastWhile { it > 'c' }) // [a, b, c]
//sampleEnd
}