lastIndexOf
Returns the index of the last occurrence of the specified element in the list, or -1 if the specified element is not contained in the list.
For lists containing more than Int.MAX_VALUE elements, a result of this function is unspecified.
Since Kotlin
1.1Samples
import kotlin.math.*
import kotlin.test.*
fun main() {
//sampleStart
val list = listOf('a', 'b', 'c', 'a')
println(list.lastIndexOf('a')) // 3
println(list.lastIndexOf('b')) // 1
println(list.lastIndexOf('e')) // -1
//sampleEnd
}