title: How to detect Carriage return in a string
body: <p>Here is the problem. I am working on a project in WPF and C# with 4.0 .net platform. I have a string which i got from a textbox with Accepts return = "true". The string is as follows</p>
  
  <pre><code>string P = @"Copyright 1995-2010 BYTES.
              All rights Reserved.
              Formerly "TheScripts.com" from 2005-2008";
  </code></pre>
  
  <p>Now i want to detect when the  carriage return character is encountered. So that i can cut the string short to just "Copyright 1995-2010 BYTES." and remove all the characters after carriage return is encountered.</p>
  
  <p>I tried doing this </p>
  
  <pre><code>string ip = datarow[0].ToString();
  string trimed= ip.TrimEnd(new char[] {'\r','\n'});
  profileFNcb.Items.Add(trimed);    
  </code></pre>
  
  <p>NOT WORKING PLEASE HELP GUYS</p>