W3cubDocs

/Kotlin

find

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
inline fun <T> Array<out T>.find(
    predicate: (T) -> Boolean
): T?
inline fun ByteArray.find(
    predicate: (Byte) -> Boolean
): Byte?
inline fun ShortArray.find(
    predicate: (Short) -> Boolean
): Short?
inline fun IntArray.find(predicate: (Int) -> Boolean): Int?
inline fun LongArray.find(
    predicate: (Long) -> Boolean
): Long?
inline fun FloatArray.find(
    predicate: (Float) -> Boolean
): Float?
inline fun DoubleArray.find(
    predicate: (Double) -> Boolean
): Double?
inline fun BooleanArray.find(
    predicate: (Boolean) -> Boolean
): Boolean?
inline fun CharArray.find(
    predicate: (Char) -> Boolean
): Char?
inline fun <T> Iterable<T>.find(
    predicate: (T) -> Boolean
): T?
@ExperimentalUnsignedTypes inline fun UIntArray.find(
    predicate: (UInt) -> Boolean
): UInt?
@ExperimentalUnsignedTypes inline fun ULongArray.find(
    predicate: (ULong) -> Boolean
): ULong?
@ExperimentalUnsignedTypes inline fun UByteArray.find(
    predicate: (UByte) -> Boolean
): UByte?
@ExperimentalUnsignedTypes inline fun UShortArray.find(
    predicate: (UShort) -> Boolean
): UShort?

Returns the first element matching the given predicate, or null if no such element was found.

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