title: C# Problem trimming line breaks within strings
body: <p>I have a string that is populated from an Xceed datagrid, as such:</p>
  
  <pre><code>study = row.Cells["STUDY_NAME"].Value.ToString().TrimEnd  (Environment.NewLine.ToCharArray());
  </code></pre>
  
  <p>However, when I pass the study string into another part of the program, it throws an error as the string is still showing as :  "PI3K1003\n  "  </p>
  
  <p>I have also tried:</p>
  
  <pre><code>TrimEnd('\r', '\n');
  </code></pre>
  
  <p>Anybody any ideas?</p>
  
  <p>Thanks.</p>