What is the difference between \r and \n?

后端 未结 9 2309
庸人自扰
庸人自扰 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:20

    • "\r" => Return
    • "\n" => Newline or Linefeed (semantics)

    • Unix based systems use just a "\n" to end a line of text.

    • Dos uses "\r\n" to end a line of text.
    • Some other machines used just a "\r". (Commodore, Apple II, Mac OS prior to OS X, etc..)

提交回复
热议问题