What are all escape characters?

I know some escape characters in Java, for example

\n : Newline \r : Carriage return \t : Tab \\ : Backslash ... 

Is there a complete list somewhere?

+83
java string escaping
Sep 02 '09 at 12:10
source share
4 answers

You can find the full list here .

  • \t Insert a tab in the text at this point.
  • \b Insert inverse text space at this point.
  • \n Insert a new line in the text into the text.
  • \r Insert the caret text into the text at this point.
  • \f Paste the form text into the text at this point.
  • \' Insert a single quote character in this text.
  • \" Insert a double quote character in the text at this moment.
  • \\ Insert a backslash character in the text at this point.
+125
Sep 02 '09 at 12:14
source share
 Java Escape Sequences: \u{0000-FFFF} /* Unicode [Basic Multilingual Plane only, see below] hex value does not handle unicode values higher than 0xFFFF (65535), the high surrogate has to be separate: \uD852\uDF62 Four hex characters only (no variable width) */ \b /* \u0008: backspace (BS) */ \t /* \u0009: horizontal tab (HT) */ \n /* \u000a: linefeed (LF) */ \f /* \u000c: form feed (FF) */ \r /* \u000d: carriage return (CR) */ \" /* \u0022: double quote (") */ \' /* \u0027: single quote (') */ \\ /* \u005c: backslash (\) */ \{0-377} /* \u0000 to \u00ff: from octal value 1 to 3 octal digits (variable width) */ 

Basic Multilingual Plane are unicode values ​​from 0x0000 to 0xFFFF (0 - 65535). Additional planes can be indicated only in Java by a few characters: egyptian heiroglyph A054 (laying down) - U+1303F / 𓀿 and should be split into "\uD80C\uDC3F" (UTF-16) for Java strings. Some other languages ​​support higher planes using "\U0001303F" .

+28
Mar 15 '15 at 18:28
source share

Yes, the docs.Oracle link below is where you can find a complete list of escape characters in Java.

Escape characters are always preceding "\" and are used to perform a specific task, such as moving to the next line, etc.

More about the Escape symbol See the following link:

https://docs.oracle.com/javase/tutorial/java/data/characters.html

0
Jun 19 '15 at 16:31
source share

These are escape characters that are used to control the string.

\ t Insert a tab in the text at this point. \ b At this point, paste the text into the text box. \ n At this point, add a new line to the text. \ r At this point, enter the caret text in the text. \ f At this point, enter the form text into the text. \ 'Insert one quotation mark in the text. \ "Insert the double quote character in the text at this moment. \ Insert the backslash character in the text at this moment.

Read more about them here.

 http://docs.oracle.com/javase/tutorial/java/data/characters.html 
0
Feb 06 '17 at 10:52
source share



All Articles