I know some of the escape characters in Java, e.g.
我知道Java中的一些转义字符。
\n : Newline
\r : Carriage return
\t : Tab
\\ : Backslash
...
Is there a complete list somewhere?
有完整的清单吗?
4 个解决方案
#1
139
You can find the full list here.
你可以在这里找到完整的列表。
-
\t
Insert a tab in the text at this point. - 在这一点上插入一个标签。
-
\b
Insert a backspace in the text at this point. - 此时在文本中插入一个回距。
-
\n
Insert a newline in the text at this point. - 此时在文本中插入一行新行。
-
\r
Insert a carriage return in the text at this point. - 此时在文本中插入一个回车。
-
\f
Insert a formfeed in the text at this point. - 此时在文本中插入一个formfeed。
-
\'
Insert a single quote character in the text at this point. - 此时在文本中插入一个引号字符。
-
\"
Insert a double quote character in the text at this point. - 这时在文本中插入一个双引号字符。
-
\\
Insert a backslash character in the text at this point. - 这时在文本中插入一个反斜线字符。
#2
32
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) */
The Basic Multilingual Plane is the unicode values from 0x0000 - 0xFFFF (0 - 65535). Additional planes can only be specified in Java by multiple characters: the egyptian heiroglyph A054 (laying down dude) is U+1303F
/ 𓀿
and would have to be broken into "\uD80C\uDC3F"
(UTF-16) for Java strings. Some other languages support higher planes with "\U0001303F"
.
基本的多语言平面是来自0x0000 - 0xFFFF(0 - 65535)的unicode值。额外的平面只能由多个字符在Java中指定:埃及的heiroglyph A054(卧位)是U+1303F / ????并且必须被分解为“\uD80C\uDC3F”(UTF-16)用于Java字符串。其他一些语言支持“\U0001303F”的更高层次。
#3
0
Yes, below is a link of docs.Oracle where you can find complete list of escape characters in Java.
是的,下面是文档链接。在Oracle中,您可以在Java中找到转义字符的完整列表。
Escape characters are always preceded with "\" and used to perform some specific task like go to next line etc.
转义字符总是以“\”开头,用于执行某些特定的任务,如转到下一行等等。
For more Details on Escape Character Refer following link:
有关转义字符的详细信息,请参阅以下链接:
https://docs.oracle.com/javase/tutorial/java/data/characters.html
https://docs.oracle.com/javase/tutorial/java/data/characters.html
#4
0
These are escape characters which are used to manipulate string.
这些转义字符用于操作字符串。
\t Insert a tab in the text at this point.
\b Insert a backspace in the text at this point.
\n Insert a newline in the text at this point.
\r Insert a carriage return in the text at this point.
\f Insert a form feed in the text at this point.
\' Insert a single quote character in the text at this point.
\" Insert a double quote character in the text at this point.
\\ Insert a backslash character in the text at this point.
Read more about them from here.
从这里阅读更多关于他们的信息。
http://docs.oracle.com/javase/tutorial/java/data/characters.html
http://docs.oracle.com/javase/tutorial/java/data/characters.html
#1
139
You can find the full list here.
你可以在这里找到完整的列表。
-
\t
Insert a tab in the text at this point. - 在这一点上插入一个标签。
-
\b
Insert a backspace in the text at this point. - 此时在文本中插入一个回距。
-
\n
Insert a newline in the text at this point. - 此时在文本中插入一行新行。
-
\r
Insert a carriage return in the text at this point. - 此时在文本中插入一个回车。
-
\f
Insert a formfeed in the text at this point. - 此时在文本中插入一个formfeed。
-
\'
Insert a single quote character in the text at this point. - 此时在文本中插入一个引号字符。
-
\"
Insert a double quote character in the text at this point. - 这时在文本中插入一个双引号字符。
-
\\
Insert a backslash character in the text at this point. - 这时在文本中插入一个反斜线字符。
#2
32
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) */
The Basic Multilingual Plane is the unicode values from 0x0000 - 0xFFFF (0 - 65535). Additional planes can only be specified in Java by multiple characters: the egyptian heiroglyph A054 (laying down dude) is U+1303F
/ 𓀿
and would have to be broken into "\uD80C\uDC3F"
(UTF-16) for Java strings. Some other languages support higher planes with "\U0001303F"
.
基本的多语言平面是来自0x0000 - 0xFFFF(0 - 65535)的unicode值。额外的平面只能由多个字符在Java中指定:埃及的heiroglyph A054(卧位)是U+1303F / ????并且必须被分解为“\uD80C\uDC3F”(UTF-16)用于Java字符串。其他一些语言支持“\U0001303F”的更高层次。
#3
0
Yes, below is a link of docs.Oracle where you can find complete list of escape characters in Java.
是的,下面是文档链接。在Oracle中,您可以在Java中找到转义字符的完整列表。
Escape characters are always preceded with "\" and used to perform some specific task like go to next line etc.
转义字符总是以“\”开头,用于执行某些特定的任务,如转到下一行等等。
For more Details on Escape Character Refer following link:
有关转义字符的详细信息,请参阅以下链接:
https://docs.oracle.com/javase/tutorial/java/data/characters.html
https://docs.oracle.com/javase/tutorial/java/data/characters.html
#4
0
These are escape characters which are used to manipulate string.
这些转义字符用于操作字符串。
\t Insert a tab in the text at this point.
\b Insert a backspace in the text at this point.
\n Insert a newline in the text at this point.
\r Insert a carriage return in the text at this point.
\f Insert a form feed in the text at this point.
\' Insert a single quote character in the text at this point.
\" Insert a double quote character in the text at this point.
\\ Insert a backslash character in the text at this point.
Read more about them from here.
从这里阅读更多关于他们的信息。
http://docs.oracle.com/javase/tutorial/java/data/characters.html
http://docs.oracle.com/javase/tutorial/java/data/characters.html