kotlin iterate list exclude last one code example
Example: kotlin iterate list exclude last one
package com.zetcode
fun main() {
val words = listOf("pen", "cup", "dog", "person",
"cement", "coal", "spectacles")
println()
for (i in 0 until words.size - 1) {
print("${words[i]} ")
}
}