n is Unix, r is Mac, rn 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 rn ?! for more information. Happy reading
The Difference
There are a few characters which can indicate a new line. The usual ones are these two:
* ‘n’ or ‘0x0A’ (10 in decimal) -> This character is called “Line Feed” (LF).
* ‘r’ or ‘0x0D’ (13 in decimal) -> This one is called “Carriage return” (CR).
Different Operating Systems handle newlines in a different way. Here is a short list of the most common ones:
* DOS and Windows
They expect a newline to be the combination of two characters, namely ‘rn’ (or 13 followed by 10).
* Unix (and hence Linux as well)
Unix uses a single ‘n’ to indicate a new line.
* Mac
Macs use a single ‘r’.
Taken from Here