C# App: Basic Text Writing Question - Blank Lines

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ShapeMan
    New Member
    • Feb 2008
    • 3

    C# App: Basic Text Writing Question - Blank Lines

    Hi there,

    I'm writing a log file using File.AppendText in C# like so:

    swLog.WriteLine (msg);

    The file is closed and re-opened when another result is ready to be logged. In the output file I get the following:

    <Blank line>
    msg
    <Blank line?
    msg

    etc.

    I don't want these blank lines so I tried swLog.Write(msg ); but that obviously leads to the lines being written one after the other, not on a new line. So how do I get each msg written to it's own line without a blank line in between?
Working...