C# go to next item in list based on if statement in foreach

前端 未结 5 2260
深忆病人
深忆病人 2020-12-14 05:42

I am using C#. I have a list of items. I loop through each item using a foreach. Inside my foreach I have a lot of if statements ch

5条回答
  •  萌比男神i
    2020-12-14 05:50

    Try this:

    foreach (Item item in myItemsList)
    {
      if (SkipCondition) continue;
      // More stuff here
    }
    

提交回复
热议问题