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?
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);
Thanks.
var lines=new[] {"Line1","Line2","Line3"}