last

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

Returns the last element.

Exceptions

NoSuchElementException - if the array is empty.

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

Returns the last element matching the given predicate.

Exceptions

NoSuchElementException - if no such element is found.

fun <T> Iterable<T>.last(): T (source)

Returns the last element.

Exceptions

NoSuchElementException - if the collection is empty.

fun <T> List<T>.last(): T (source)

Returns the last element.

Exceptions

NoSuchElementException - if the list is empty.