\r\n、\r 和\n 之间有什么区别? [英] What is the difference between \r\n, \r, and \n?

查看:51
本文介绍了\r\n、\r 和\n 之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

\r\n\r\n 之间的字符串有什么区别?每个字符串如何影响字符串?

What is difference in a string between \r\n, \r and \n? How is a string affected by each?

我必须用 \n 替换 \r\n\r 的出现,但我不知道它们有什么不同在一个字符串...

I have to replace the occurrences of \r\n and \r with \n, but I cannot get how are they different in a string...

我知道 \r 就像回车,而 \n 是换行.

I know that \r is like hitting enter and \n is for a new line.

推荐答案

  • \r = CR(回车)→在 X 之前的 Mac OS 中用作换行符
  • \n = LF(换行)→在 Unix/Mac OS X 中用作换行符
  • \r\n = CR + LF →在 Windows 中用作换行符
  • 这篇关于\r\n、\r 和\n 之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆