Answers for "for each loop kotline to get the index"

1

foreach index kotlin

for ((index, value) in array.withIndex()) {
    println("the element at $index is $value")
}
Posted by: Guest on January-09-2022
1

for loop in kotlin with index

collection.forEachIndexed { index, element ->
    // ...
}
Posted by: Guest on January-07-2021

Browse Popular Code Answers by Language