C# C# Streams and Data Processing Reading Data Breaking It Up Into Lines

Stepas Loiba
Stepas Loiba
11,180 Points

Can some one help with meaning of '\r' and '\n' ?pleae

Hi,maybe some can help me understand meaning behind '\r' and '\n' in method she called to split.some parts really hard to understand. Thank you in advance :)

1 Answer

Steven Parker
Steven Parker
177,888 Points

These are just abbreviations for non-visible output control characters.

The code "\r" stands for the carriage return character, which can also be coded as "\u000D". It causes anything following it to be printed at the beginning of the line.

The code "\n" stands for the newline character, which can also be coded as "\u000A". It causes anything following it to be printed on the next line below.

Typically, both of these are generated in sequence when the "ENTER" key on a keyboard is pressed.