Break at label is a convenient way to jump out of a nested loop.
In [3]:
loop@ for (i in 1..5) {
for (j in 1..5) {
if (j > 1) break@loop
println("i: ${i}, j: ${j}")
}
}
Out[3]:
In [ ]:
Break at label is a convenient way to jump out of a nested loop.
loop@ for (i in 1..5) {
for (j in 1..5) {
if (j > 1) break@loop
println("i: ${i}, j: ${j}")
}
}