For 循环

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

for (index in items.indices) { println("item at $index is ${items[index]}") }

你可能感兴趣的:(For 循环)