fun <T> Array<out T>.firstOrNull(): T? (source)
fun ByteArray.firstOrNull(): Byte? (source)
fun ShortArray.firstOrNull(): Short? (source)
fun IntArray.firstOrNull(): Int? (source)
fun LongArray.firstOrNull(): Long? (source)
fun FloatArray.firstOrNull(): Float? (source)
fun DoubleArray.firstOrNull(): Double? (source)
fun BooleanArray.firstOrNull(): Boolean? (source)
fun CharArray.firstOrNull(): Char? (source)

Returns the first element, or null if the array is empty.

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

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

fun <T> Iterable<T>.firstOrNull(): T? (source)

Returns the first element, or null if the collection is empty.

fun <T> List<T>.firstOrNull(): T? (source)

Returns the first element, or null if the list is empty.