C#中的\r\n和\n\r什么区别

enter+newline with different platforms:
windows: \r\n
mac: \r

unix/linux: \n


in "abc" + ”\n\rdef”, \n\r do not match any platform,so it is considered as \n and \r (which match unix/linux and mac),so there are two new lines.(有两个空行)


in "abc" + ”\r\ndef” \r\n matches the windows platform,so it is considered as only one new line.(有一个空行)

猜你喜欢

转载自blog.csdn.net/vs920079469vs/article/details/79182132
今日推荐