Java Escape Character Table

Source: Internet
Author: User

Vertex'sTransfer
Yi
:. ==> U002e

Dollar signTransfer
Yi
: $ ==> U0024

Multiplication symbolTransfer
Yi
: ^ => U005e

Left bracesTransfer
Yi
: {=> U007b

Left square bracketsTransfer
Yi
: [==> U005b

Left parenthesesTransfer
Yi
:( ==> U0028

VerticalTransfer
Yi
: |=> U007c

Right parenthesisTransfer
Yi
:) ==> U0029

AsteriskTransfer
Yi
: * ==> U002a

Plus signTransfer
Yi
: + ==> U002b

Question markTransfer
Yi
:? ==> U003f

BackslashTransfer
Yi
:=> U005c

 

Example 1:

String str2="a$b$c";
String strs[]=str2.split("$");
for(String str:strs){
System.out.println(str);

It does not output a, B, c needsTransfer
Yi
Such:

String str2 = "A $ B $ C ";
String STRs [] = str2.split ("// u0024 ");
For (string STR: STRs ){
System. Out. println (STR );

Example 2:
String S = "E: // JBX // x9 // io9 ";
String SS;
Ss = S. replaceall ("////","////////");
System. Out. println ("s =" + S );
System. Out. println ("SS =" + SS );

// Output: output result
// S = E:/JBX/x9/io9
// Ss = E: // JBX // x9 // io9
Example 3:
String AA = "WAP/cnlive/318/321/Index *. WML ";
String [] filepatharray = AA. Split ("[//]");
For (INT I = 0; I <filepatharray. length; I ++ ){
String string = filepatharray [I];
System. Out. println ("str" + I + ":" + String );
}
Output result:
STR 0: WAP
STR 1: cnlive
STR 2: 318
STR 3: 321
STR 4: Index *. WML ,,

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.