问题:
In a C# (feel free to answer for other languages) loop, what's the difference between break and continue as a means to leave the structure of the loop, and go to the next iteration? 在C#(随意回答其他语言)循环中,break和continue之间的区别是什么,作为离开循环结构的手段,并进入下一次迭代?
Example: 例:
foreach (DataRow row in myTable.Rows)
{
if (someConditionEvalsToTrue)
{
break; //what's the difference between this and continue ?
//continue;
}
}
解决方案:
参考一: https://stackoom.com/question/1fS/C-循环-中断与继续参考二: https://oldbug.net/q/1fS/C-loop-break-vs-continue
来源:oschina
链接:https://my.oschina.net/u/4437974/blog/4329936