getOrNull

fun <T> Array<out T>.getOrNull(index: Int): T?(source)

Returns an element at the given index or null if the index is out of bounds of this array.

Since Kotlin

1.0

Samples


fun <T> List<T>.getOrNull(index: Int): T?(source)

Returns an element at the given index or null if the index is out of bounds of this list.

Since Kotlin

1.0

Samples


Returns an element at the given index or null if the index is out of bounds of this array.

Since Kotlin

1.3

Samples