title: C# \n, \r\n or Environment.NewLine
body: <p>As the heading implies, would I be best to use <code>\n</code>, <code>\r\n</code> or <code>System.Environment.NewLine</code> for line breaks in my C# applications?</p>
  
  <p>I have a console, WinForms and WPF app which at present all use <code>\n</code> (where required), but in my console app I have found that when redirecting output from the CLi and open the output in Notepad the line breaks are not correctly recognised. I could just alter my behaviour for this one app but I am seeking the advice of those who consistently use a particular method and why.</p>
  
  <p>Cheers!</p>
  
  <p>Update:</p>
  
  <p>So the general consensus is that use <code>System.Environment.NewLine</code> unless a specific requirement arises which needs <code>\n</code> (Unix/OS X), <code>\r</code> (OS 9) or <code>\r\n</code> (Windows)</p>
  
  <p>Thanks all and sorry about the dup!</p>