相关疑难解决方法(0)

C#循环 - 中断与继续

在C#(随意回答其他语言)循环中,break和continue之间的区别是什么,作为离开循环结构的手段,并进入下一次迭代?

例:

foreach (DataRow row in myTable.Rows)
{
    if (someConditionEvalsToTrue)
    {
        break; //what's the difference between this and continue ?
        //continue;
    }
}
Run Code Online (Sandbox Code Playgroud)

c# loops enumeration

777
推荐指数
12
解决办法
72万
查看次数

标签 统计

c# ×1

enumeration ×1

loops ×1