on Each Indexed
inline fun <T> Array<out T>.onEachIndexed(action: (index: Int, T) -> Unit): Array<out T>
Content copied to clipboard
inline fun ByteArray.onEachIndexed(action: (index: Int, Byte) -> Unit): ByteArray
Content copied to clipboard
inline fun ShortArray.onEachIndexed(action: (index: Int, Short) -> Unit): ShortArray
Content copied to clipboard
inline fun IntArray.onEachIndexed(action: (index: Int, Int) -> Unit): IntArray
Content copied to clipboard
inline fun LongArray.onEachIndexed(action: (index: Int, Long) -> Unit): LongArray
Content copied to clipboard
inline fun FloatArray.onEachIndexed(action: (index: Int, Float) -> Unit): FloatArray
Content copied to clipboard
inline fun DoubleArray.onEachIndexed(action: (index: Int, Double) -> Unit): DoubleArray
Content copied to clipboard
inline fun BooleanArray.onEachIndexed(action: (index: Int, Boolean) -> Unit): BooleanArray
Content copied to clipboard
inline fun CharArray.onEachIndexed(action: (index: Int, Char) -> Unit): CharArray
Content copied to clipboard
inline fun UIntArray.onEachIndexed(action: (index: Int, UInt) -> Unit): UIntArray
Content copied to clipboard
inline fun ULongArray.onEachIndexed(action: (index: Int, ULong) -> Unit): ULongArray
Content copied to clipboard
inline fun UByteArray.onEachIndexed(action: (index: Int, UByte) -> Unit): UByteArray
Content copied to clipboard
inline fun UShortArray.onEachIndexed(action: (index: Int, UShort) -> Unit): UShortArray
Content copied to clipboard
Performs the given action on each element, providing sequential index with the element, and returns the array itself afterwards.
Since Kotlin
1.4
Parameters
action
function that takes the index of an element and the element itself and performs the action on the element.
inline fun <T, C : Iterable<T>> C.onEachIndexed(action: (index: Int, T) -> Unit): C
Content copied to clipboard
Performs the given action on each element, providing sequential index with the element, and returns the collection itself afterwards.
Since Kotlin
1.4
Parameters
action
function that takes the index of an element and the element itself and performs the action on the element.
inline fun <K, V, M : Map<out K, V>> M.onEachIndexed(action: (index: Int, Map.Entry<K, V>) -> Unit): M
Content copied to clipboard
Performs the given action on each entry, providing sequential index with the entry, and returns the map itself afterwards.
Since Kotlin
1.4
Parameters
action
function that takes the index of an entry and the entry itself and performs the action on the entry.