Wednesday, May 25, 2011

Difference Between \n, \r, and Environment.NewLine

\n 
  • CR (Carriage Return)
  • Same as (char)13
  • Used as a new line character in Unix
\r
  • LF (Line Feed)
  • Used as a new line character in Mac OS
\n\r
  • CR + LF (Carriage Return + Line Feed)
  • Used as a new line character in Windows
Environment.NewLine
  • Any of the above codes, based on the Operating System
  • This is the preferred method


No comments:

Post a Comment