【发布时间】:2018-12-23 04:49:04
【问题描述】:
我可以在正常的 for 循环中使用continue。
for (i in 0..10) {
// .. some initial code
if (i == something) continue
// .. some other code
}
但是在forEach中好像不能用
(0 .. 10).forEach {
// .. some initial code
if (i == something) continue
// .. some other code
}
有没有办法为forEach 使用类似的continue 语句?
【问题讨论】:
标签: kotlin