Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does \n\r mean?

Tags:

ascii

When reading from a pseudo-terminal via java, I'm seeing "\n\r" in the text. What is that representative of? Note its not "\r\n" which I'm familiar with.

like image 225
Baz Avatar asked Dec 06 '12 14:12

Baz


People also ask

Whats does NR mean?

written abbreviation for near , used, for example, as part of an address: Bray, nr Dublin.

What is RN mean in texting?

RN stands for Right Now. RN is an internet slang initialism used to express immediacy.

What does na R stand for?

Key Takeaways. The National Association of Realtors (NAR) is the professional organization for real estate agents and other industry professionals in the U.S. and abroad. Members, known as realtors, have access to a variety of benefits and tools designed to enhance their real estate businesses.

What does NR mean when ordering online?

'NR' is used in European countries and other countries - as abbreviation for 'Number'. 'NO' is also used in European countries as abbreviation for 'Number'. 'NO' is used here in the US as abbreviation for 'number'.


1 Answers

\n is a line feed (ASCII code 10), \r is a carriage return (ASCII code 13).

Different operating systems use different combinations of these characters to represent the end of a line of text. Unix-like operating systems (Linux, Mac OS X) usually use only \n. MS-DOS and Windows use \r\n (carriage return, followed by a line feed).

The code you're using uses \n\r (line feed, carriage return). There are operating systems that use that sequence, but probably it's a mistake and it should have been \r\n.

See Newline on Wikipedia.

If you're programming in Java and you want to know what the newline sequence is for the operating system that your program is running on, you can get the system property line.separator:

String newline = System.getProperty("line.separator");
like image 132
Jesper Avatar answered Oct 12 '22 09:10

Jesper