title: How to remove selected rows from a listView
body: <p>I want to remove rows from a listview after checking for a particular string. If the string in
  the textbox matches the string in the listview, the row remains, otherwise the row is remove. 
  The 2 foreach loop and the top part of the if statement works fine, however the else section is what giving me problem.... I am not sure how to code it.</p>
  
  <p>Thanks in advance</p>
  
  <p>code so far:-</p>
  
  <pre><code>foreach (ListViewItem item in listView1.Items)
  {
      foreach (ListViewItem.ListViewSubItem subItem in item.SubItems)
      {
          if (subItem.Text.ToLower().StartsWith(textBox1.Text.ToLower()))
          {
              var index = item.Index;
              MessageBox.Show(listView1.Items[index].ToString());
              count++;
          }
          else
          {
              listView1.Items[item].Remove();
          }               
      }   
  }        
  </code></pre>