title: Output string with line breaks to file in console application
body: <p>I am having problems handling line breaks in the out data for a console application I an working on. The simplfied example below is writing outDataString to out.txt without line breaks. Any thoughts on how to achieve line breaks in out.txt in this case?</p>
  
  <pre><code>FileStream ostrm;
  StreamWriter writer;
  
  string outDataString = "Hi, this is the out data.\nWith a few\n line breaks.";
  
  ostrm = new FileStream("out.txt", FileMode.OpenOrCreate, FileAccess.Write);                
  writer = new StreamWriter(outDataString);
  
  Console.SetOut(writer);
  Console.write(outDataString);
  </code></pre>
  
  <p>Thanks.</p>