Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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
229,732 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.