fun forLoopListItems() {
val items = listOf("apple", "banana", "kiwifruit")
for (i in items) {
if (i.equals("banana")) {
println("position is ${i.indices}")
}
}
}
This is My Kotlin code used with For Loop. I tried to Print Index Curresponding to "banana" But Result is "System.out: position is 0..5" How is it Become 0..5 ?