Let me correct you first: Windows is CRLF,Linux 是 LF,Mac 是 CR
What to use? In fact, it doesn’t matter much. As long as the text editor supports it, you can use any line ending mark - of course "Notepad" does not support it. If you use Notepad to open a file with LF as the end character, it will There are no branches.
In addition, like Git, Windows will by default convert CRLF to LF when submitting the code before submitting it. When updating the code, it will also convert LF to CRLF to achieve system compatibility.
Of course, there is another problem that you may need to pay attention to when developing read/write (note not just reading) text files.
Let me correct you first: Windows is
CRLF
,Linux 是LF
,Mac 是CR
What to use? In fact, it doesn’t matter much. As long as the text editor supports it, you can use any line ending mark - of course "Notepad" does not support it. If you use Notepad to open a file with
LF
as the end character, it will There are no branches.In addition, like Git, Windows will by default convert CRLF to LF when submitting the code before submitting it. When updating the code, it will also convert LF to CRLF to achieve system compatibility.
Of course, there is another problem that you may need to pay attention to when developing read/write (note not just reading) text files.