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.(有一个空行)

你可能感兴趣的:(C#)