C#中的\r\n和\n\r什么区别
答案:3 悬赏:0
解决时间 2021-01-30 10:15
- 提问者网友:像風在裏
- 2021-01-29 21:48
C#中的\r\n和\n\r什么区别
最佳答案
- 二级知识专家网友:拾荒鲤
- 2021-01-29 22:52
区别在于 前者的字节顺序是 0D 0A ,而后者是 0A 0D。
这在显示的时候没什么关系,Unix 系统甚至不需要 \r 。
但是许多因特网协议,比如 FTP、HTTP 就要求 0D 0A。
这在显示的时候没什么关系,Unix 系统甚至不需要 \r 。
但是许多因特网协议,比如 FTP、HTTP 就要求 0D 0A。
全部回答
- 1楼网友:几近狂妄
- 2021-01-30 00:52
顺序上有区别,别的区别不大。
输出是回车换行,效果一样
输出是回车换行,效果一样
- 2楼网友:鱼芗
- 2021-01-30 00:15
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/linuxand 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.
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/linuxand 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.
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯