Difference between CR LF, LF and CR line break types?

前端 未结 9 2283
春和景丽
春和景丽 2020-11-22 04:05

I\'d like to know the difference (with examples if possible) between CR LF (Windows), LF (Unix) and CR (Macintosh) line break types.

9条回答
  •  梦如初夏
    2020-11-22 04:23

    CR - ASCII code 13

    LF - ASCII code 10.

    Theoretically CR returns cursor to the first position (on the left). LF feeds one line moving cursor one line down. This is how in old days you controled printers and text-mode monitors. These characters are usually used to mark end of lines in text files. Different operating systems used different conventions. As you pointed out Windows uses CR/LF combination while pre-OSX Macs use just CR and so on.

提交回复
热议问题