August 21, 2026

Carriage Return and Line Feed

I always forget these so here is a note so that I can look them up easily. You can get the default newline charaters for the current system using the "Environment.NewLine".
Carriage Return (CR, '\r', ASCII 13): A Carriage return, takes the paper carriage back to the beginning of the line. In computing this control character repositions the cursor to the beginning of the line without going down to the next line.
Line Feed (LF, '\n', ASCII 10): In a typewriter, the line feed will help advance the paper by one line. In computing, this tip moves the cursor down to the next line without going back to the start of the line again.
On Windows it is Carriage return, Line feed or "\r\n"
I believe Linux and Unix and Mac OS (?) use "\n"

No comments: