Difference between "\n" and Environment.NewLine

Prerak K picture Prerak K · Jun 19, 2009 · Viewed 338k times · Source

What is the difference between two, if any (with respect to .Net)?

Answer

anthony picture anthony · Jun 19, 2009

Depends on the platform. On Windows it is actually "\r\n".

From MSDN:

A string containing "\r\n" for non-Unix platforms, or a string containing "\n" for Unix platforms.