title: C# go to next item in list based on if statement in foreach
body: <p>I am using C#.  I have a list of items.  I loop through each item using a <code>foreach</code>.  Inside my <code>foreach</code> I have a lot of <code>if</code> statements checking some stuff.  If any of these <code>if</code> statements returns a false then I want it to skip that item and go to the next item in the list.  All <code>if</code> statements that follow should be ignored.  I tried using a break but a break exits the whole <code>foreach</code> statement.</p>
  
  <p>This is what I currently have:</p>
  
  <pre><code>foreach (Item item in myItemsList)
  {
     if (item.Name == string.Empty)
     {
        // Display error message and move to next item in list.  Skip/ignore all validation
        // that follows beneath
     }
  
     if (item.Weight &gt; 100)
     {
        // Display error message and move to next item in list.  Skip/ignore all validation
        // that follows beneath
     }
  }
  </code></pre>
  
  <p>Thanks</p>