kotlin.collections.withIndex

withIndex

fun <T> Iterator<T>.withIndex(): Iterator<IndexedValue<T>>

Returns an Iterator wrapping each value produced by this Iterator with the IndexedValue, containing value and it's index.

fun <T> Iterable<T>.withIndex(): Iterable<IndexedValue<T>><