title: How to iterate and update a list
body: <p>I have had this problem lots over time, if I iterate a list, and modify the list in the process it causes an exception.</p>
  
  <pre><code>List&lt;string&gt; list = new List&lt;string&gt;()
                                  {
                                      "one",
                                      "two",
                                      "three"
                                  };
  
          foreach (string item in list)
          {
              if (item == "two")
              {
                  list.Remove(item);
              }
          }
  </code></pre>
  
  <p>I have come up with my own solutions, but interested to hear your solutions.</p>