打破for循环嵌套 发表于 2019-05-19 分类于 Swift exitLoop: for i in 0...100 { print("i=\(i)") if i == 50 { // break } else { for j in 0...100 { print("j=\(j)") if j == 50 { break exitLoop } } } } 参考: https://www.hackingwithswift.com/example-code/language/how-to-break-out-of-multiple-loop-levels-using-labeled-statements –EOF– 本文作者: Optional 本文链接: https://jingxuetao.com/how-to-break-out-of-multiple-loop-levels-using-labeled-statements/ 版权声明: 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!