What is the difference between \r and \n?

后端 未结 9 2370
庸人自扰
庸人自扰 2020-11-22 06:20

How are \\r and \\n different? I think it has something to do with Unix vs. Windows vs. Mac, but I\'m not sure exactly how they\'re different, and

9条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-22 07:18

    In short \r has ASCII value 13 (CR) and \n has ASCII value 10 (LF). Mac uses CR as line delimiter (at least, it did before, I am not sure for modern macs), *nix uses LF and Windows uses both (CRLF).

提交回复
热议问题