What are all the escape characters?

后端 未结 4 1095
被撕碎了的回忆
被撕碎了的回忆 2020-11-22 05:18

I know some of the escape characters in Java, e.g.

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

Is there a complete l

4条回答
  •  隐瞒了意图╮
    2020-11-22 06:09

    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".

提交回复
热议问题