Ottenere indice foreach kotlin

Esempi di codice

1
0

per il ciclo in kotlin con indice

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

foreach indice di kotlin

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

In altre lingue

Questa pagina è in altre lingue

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