title: How to remove blank lines from a C# List<string>?
body: <p>I am trying to create a routine in C# that sorts a list added to a Multi-Line text box.  Once that is done, there is an option to remove all blank lines.  Can someone tell me how I would go about doing this?  here is what I have so far, but it doesn't work at all when I select the box and click sort:</p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
  {
      char[] delimiterChars = { ',',' ',':','|','\n' };
      List&lt;string&gt; sortBox1 = new List&lt;string&gt;(textBox2.Text.Split(delimiterChars));
  
      if (checkBox3.Checked) //REMOVE BLANK LINES FROM LIST
      {
          sortBox1.RemoveAll(item =&gt; item == "\r\n");
      }
  
      textBox3.Text = string.Join("\r\n", sortBox1);
  }
  </code></pre>