What is newline character — '\n'

前端 未结 8 2121
挽巷
挽巷 2020-12-07 01:18

This is a very basic concept, but something I have never been able to articulate that well. and I would like to try to spell it and see where I go wrong.

If I have t

8条回答
  •  [愿得一人]
    2020-12-07 02:07

    NewLine (\n) is 10 (0xA) and CarriageReturn (\r) is 13 (0xD).

    Different operating systems picked different end of line representations for files. Windows uses CRLF (\r\n). Unix uses LF (\n). Older Mac OS versions use CR (\r), but OS X switched to the Unix character.

    Here is a relatively useful FAQ.

提交回复
热议问题