for Each Indexed
inline fun <T> Array<out T>.forEachIndexed(action: (index: Int, T) -> Unit)
Content copied to clipboard
inline fun ShortArray.forEachIndexed(action: (index: Int, Short) -> Unit)
Content copied to clipboard
inline fun FloatArray.forEachIndexed(action: (index: Int, Float) -> Unit)
Content copied to clipboard
inline fun DoubleArray.forEachIndexed(action: (index: Int, Double) -> Unit)
Content copied to clipboard
inline fun BooleanArray.forEachIndexed(action: (index: Int, Boolean) -> Unit)
Content copied to clipboard
inline fun <T> Iterable<T>.forEachIndexed(action: (index: Int, T) -> Unit)
Content copied to clipboard
Performs the given action on each element, providing sequential index with the element.
Parameters
action
function that takes the index of an element and the element itself and performs the action on the element.
inline fun ULongArray.forEachIndexed(action: (index: Int, ULong) -> Unit)
Content copied to clipboard
inline fun UByteArray.forEachIndexed(action: (index: Int, UByte) -> Unit)
Content copied to clipboard
inline fun UShortArray.forEachIndexed(action: (index: Int, UShort) -> Unit)
Content copied to clipboard
Performs the given action on each element, providing sequential index with the element.
Since Kotlin
1.3
Parameters
action
function that takes the index of an element and the element itself and performs the action on the element.