lastIndexOf

fun <T> Array<out T>.lastIndexOf(element: T): Int(source)

Returns last index of element, or -1 if the array does not contain element.

Since Kotlin

1.0

fun <T> Iterable<T>.lastIndexOf(element: T): Int(source)

Returns last index of element, or -1 if the collection does not contain element.

Since Kotlin

1.0

fun <T> List<T>.lastIndexOf(element: T): Int(source)

Returns last index of element, or -1 if the list does not contain element.

Since Kotlin

1.0

Deprecated

The function has unclear behavior when searching for NaN or zero values and will be removed soon. Use 'indexOfLast { it == element }' instead to continue using this behavior, or '.asList().lastIndexOf(element: T)' to get the same search behavior as in a list.

Replace with

indexOfLast { it == element }

Returns last index of element, or -1 if the array does not contain element.

Since Kotlin

1.0