In C#, what's the difference between \n and \r\n?

Aperture picture Aperture · Oct 21, 2010 · Viewed 118.3k times · Source

As per subject...

Answer

Peter van Kekem picture Peter van Kekem · Oct 21, 2010

\n is Unix, \r is Mac, \r\n is Windows.

Sometimes it's giving trouble especially when running code cross platform. You can bypass this by using Environment.NewLine.

Please refer to What is the difference between \r, \n and \r\n ?! for more information. Happy reading