mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
14 lines
268 B
Kotlin
Vendored
14 lines
268 B
Kotlin
Vendored
// WITH_RUNTIME
|
|
|
|
val xs = listOf("a", "b", "c", "d").asSequence()
|
|
|
|
fun box(): String {
|
|
val s = StringBuilder()
|
|
|
|
for ((_, x) in xs.withIndex()) {
|
|
s.append("$x;")
|
|
}
|
|
|
|
val ss = s.toString()
|
|
return if (ss == "a;b;c;d;") "OK" else "fail: '$ss'"
|
|
} |