Obtener el índice en foreach kotlin

Ejemplos de código

1
0

bucle for en kotlin con índice de

collection.forEachIndexed { index, element ->
    // ...
}
1
0

foreach índice de kotlin

for ((index, value) in array.withIndex()) {
    println("the element at $index is $value")
}

En otros idiomas

Esta página está en otros idiomas

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................