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

后端 未结 8 1312
礼貌的吻别
礼貌的吻别 2020-12-14 00:37

As per subject...

8条回答
  •  北荒
    北荒 (楼主)
    2020-12-14 00:49

    \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

提交回复
热议问题