title: VB - How do you remove "empty" items from a generic list?
body: <p>I have a VB.NET (2010) project that contains a generic list, and I'm trying to figure out how to remove any "empty" items from the list. When I say "empty", I mean any item that does not contain any actual characters (but it may contain any amount of whitespace, or no whitespace at all). </p>
  
  <p>For example, let's say this is my list...</p>
  
  <pre><code>    Dim MyList As New List(Of String)
  
      MyList.Add("a")
      MyList.Add("")
      MyList.Add("b")
      MyList.Add(" ")
      MyList.Add("c")
      MyList.Add("      ")
      MyList.Add("d")
  </code></pre>
  
  <p>I need it so that if I did a count on that list, it would return 4 items, instead of 7. For example...</p>
  
  <pre><code>    Dim ListCount As Integer = MyList.Count
      MessageBox.Show(ListCount) ' Should show "4"
  </code></pre>
  
  <p>It would be nice if there was something like...</p>
  
  <pre><code>    MyList.RemoveEmpty
  </code></pre>
  
  <p>Anyways... I've been searching Google for a solution to this for the past few hours, but haven't been able to turn up anything so far. So... any ideas?</p>
  
  <p>BTW, I'm targeting the .NET 2.0 framework for this project.</p>
  
  <p>Thanks in advance!</p>