title: Editing an item in a list<T>
body: <p>How do I edit an item in the list in the code below:</p>
  
  <pre><code>List&lt;Class1&gt; list = new List&lt;Class1&gt;();
  
  int count = 0 , index = -1;
  foreach (Class1 s in list)
  {
      if (s.Number == textBox6.Text)
          index = count; // I found a match and I want to edit the item at this index
      count++;
  }
  
  list.RemoveAt(index);
  list.Insert(index, new Class1(...));
  </code></pre>