所以我有一些 vb.net 代码,并且在 For 循环内有一个嵌套的 For 循环,然后有 EXIT FOR 语句,它会跳出一个循环还是整个链?
最佳答案
Exit For
只会退出当前正在执行的 For
循环。
来自MSDN :
Exit For
Immediately exits the For loop in which it appears. Execution continues with the statement following the Next statement. Exit For can be used only inside a For...Next or For Each...Next loop. When used within nested For loops, Exit For exits the innermost loop and transfers control to the next higher level of nesting.
关于vb.net - 在vb.net中,当你跳出循环时,你会打破所有的嵌套循环吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10552433/