C#循环

纵然是瞬间 提交于 2021-01-30 10:14:34

问题:

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
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!