\ R = carriage return = Cr = 13
\ N = line feed = LF = 10
In Windows, press ENTER = to move the cursor to the beginning of a line, line feed = to move the cursor to the next line.
In Linux, line feed = move the cursor to the beginning of the next line.
In Mac, press ENTER = to move the cursor to the next line.
In Java's bufferedreader, The Readline method considers \ r, \ n, and \ r \ n as the delimiter of a row:
/*** Reads a line of text. A line is considered to be terminated by any one * Of a line feed ('\ n'), a carriage return (' \ R '), or a carriage return * followed immediately by a linefeed. ** @ return a string containing the contents of the line, not including * any line-termination characters, or null if the end of the * stream has been reached ** @ exception ioexception if an I/O error occurs */Public String Readline () throws ioexception {return Readline (false );}
Another overload of Readline allows you to specify whether to ignore the LF (carriage return) symbol.
/*** Reads a line of text. A line is considered to be terminated by any one * Of a line feed ('\ n'), a carriage return (' \ R '), or a carriage return * followed immediately by a linefeed. ** @ Param ignorelf if true, the next '\ n' will be skipped ** @ return a string containing the contents of the line, not including * any line-termination characters, or null if the end of the * stream has been reached ** @ see Java. io. linenumberreader # Readline () ** @ exception ioexception if an I/O error occurs */string Readline (Boolean ignorelf) throws ioexception {
Different editors have different support for line breaks.
Notepad ++ is supported, which is the same as Java by default.
In vim, the Linux rules are adhered to. The carriage return is displayed as a ^ m, and the line feed is a line break.
This is not a pure egg pain ................... Just unify it.