lastIndex

val <T> Collection<T>.lastIndex: Int

Returns the last index of Collection.

Example:

listOf(1..10).lastIndex // 9

Since

1.1.0