W3cubDocs

/Kotlin

lastIndexOf

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

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

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

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

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

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

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