您的位置:首页 > Web前端

What is the difference between '/n' and '/r/n'? /n /r/n的区别是什么

2011-01-21 17:29 696 查看
原帖来自http://www.codeguru.com/forum/showthread.php?t=253826

背景

There are a few characters which can indicate a new line. The usual ones are these two:

这里有几种表示新行开始的符号

'/n' or '0x0A' (10 in decimal) -> This character is called "Line Feed" (LF).

'/r' or '0x0D' (13 in decimal) -> This one is called "Carriage return" (CR).

不同的操作系统处理的新行字符是不一样

在Dos和Windows下

新行是按照 /r/n 这样的顺序组合起来的

在Unix和Linux 下

使用'/n'来作为新行的起始

在Mac平台下

Macs 用单个的'/r'来作为新行的起始
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐