Java Escape Character \ |, java Escape Character
Http://blog.csdn.net/stewen_001/article/details/22871737
View a program
String t = "a | B | c | d ";
String [] temp = t. split ("\\|\| ");
System.Out. Println (temp. length );
What does "\\|\|" mean?
It was a bit confusing at first, and later I understood it carefully. It turned out to be like this:
\ Is converted to a backslash. The backslash itself is an escape character, and all is "\ |". The Escape is |, SO \ | is actually "| ".
Further research: java escape characters
1. octal escape sequence: \ + 1 to 3 digits and 5 digits; range: '\ 000 '~ '\ 8080' \ 0: NULL Character
2. Unicode escape characters: \ u + four hexadecimal numbers; 0 ~ 65535 \ u0000: NULL Character
3. Special characters: Three
\ ": Double quotation marks
\ ': Single quotes
\: Backslash
4. control characters: 5
\ 'Single quotes
\ Backslash character
\ R press ENTER
\ N line feed
\ F go to paper form
\ T horizontal hop
\ B Return
Point escape:. ==> u002E
Escape of dollar signs: $ ==> u0024
Escape of the multiplication Symbol: ^ ==> u005E
Escape from the left braces: {==> u007B
Escape from left square brackets: [==> u005B
Escape of left parentheses :( ==> u0028
Escape of vertical bars: |=> u007C
Escape of right parentheses: ==> u0029
Asterisk escape: * ==> u002A
Escape of the plus sign: + ==> u002B
Escape question mark :? ==> U003F
Escape the backslash: ==> u005C
So \ | can also be written as \ u007C