lastIndexOf

Common
JVM
JS
Native
1.0
fun <T> Array<out T>.lastIndexOf(element: T): Int
(source)
fun ByteArray.lastIndexOf(element: Byte): Int
(source)
fun ShortArray.lastIndexOf(element: Short): Int
(source)
fun IntArray.lastIndexOf(element: Int): Int
(source)
fun LongArray.lastIndexOf(element: Long): Int
(source)
@DeprecatedSinceKotlin("1.4", "1.6", "1.7") fun FloatArray.lastIndexOf(
    element: Float
): Int

(source)
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.
@DeprecatedSinceKotlin("1.4", "1.6", "1.7") fun DoubleArray.lastIndexOf(
    element: Double
): Int

(source)
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.
fun BooleanArray.lastIndexOf(element: Boolean): Int
(source)
fun CharArray.lastIndexOf(element: Char): Int
(source)
@ExperimentalUnsignedTypes fun UIntArray.lastIndexOf(
    element: UInt
): Int

(source)
@ExperimentalUnsignedTypes fun ULongArray.lastIndexOf(
    element: ULong
): Int

(source)
@ExperimentalUnsignedTypes fun UByteArray.lastIndexOf(
    element: UByte
): Int

(source)
@ExperimentalUnsignedTypes fun UShortArray.lastIndexOf(
    element: UShort
): Int

(source)

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

Common
JVM
JS
Native
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.

Common
JVM
JS
Native
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.