直到功能

要创建不包含其 end 元素的范围,可以使用 until 函数:

for (i in 1 until 10) { // i in [1, 10), 10 is excluded
println(i)
}