The character '\r'
is carriage return. It returns the cursor to the start of the line.
It is often used in Internet protocols conjunction with newline ('\n'
) to mark the end of a line (most standards specifies it as "\r\n"
, but some allows the wrong way around). On Windows the carriage-return newline pair is also used as end-of-line. On the old Macintosh operating system (before OSX) a single carriage-return was used instead of newline as end-of-line, while UNIX and UNIX-like systems (like Linux and OSX) uses a single newline.