W3cubDocs

/Kotlin

takeLastWhile

inline fun <T> List<T>.takeLastWhile(
    predicate: (T) -> Boolean
): List<T>
inline fun <T> Array<out T>.takeLastWhile(
    predicate: (T) -> Boolean
): List<T>
inline fun ByteArray.takeLastWhile(
    predicate: (Byte) -> Boolean
): List<Byte>
inline fun ShortArray.takeLastWhile(
    predicate: (Short) -> Boolean
): List<Short>
inline fun IntArray.takeLastWhile(
    predicate: (Int) -> Boolean
): List<Int>
inline fun LongArray.takeLastWhile(
    predicate: (Long) -> Boolean
): List<Long>
inline fun FloatArray.takeLastWhile(
    predicate: (Float) -> Boolean
): List<Float>
inline fun DoubleArray.takeLastWhile(
    predicate: (Double) -> Boolean
): List<Double>
inline fun BooleanArray.takeLastWhile(
    predicate: (Boolean) -> Boolean
): List<Boolean>
inline fun CharArray.takeLastWhile(
    predicate: (Char) -> Boolean
): List<Char>

Returns a list containing last elements satisfying the given predicate.

© 2010–2017 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/take-last-while.html