Escape-related characters include:. * + () $ /\? [] ^ {}, Which must be escaped when searching for these characters separately.
1. jsp --> if a special character (\/.) and other symbols need to be escaped in action, you can use escape (...)
2. characters with special meanings in Java (such as line breaks, carriage returns, single quotes, and double quotation marks). If you want to use it, you must add a prefix "\", such as line feed ("\ n"), carriage return ("\ r"), and double quotation marks ("\"") and backslash.
A. Take the "\" symbol as an example. There are many operations in Java, such as file operations. The path must be used, such as com \ mypackage \ XXX. XML, this path is generally represented in the form of a string, but the problem arises. Java does not know whether your \ number is the meaning of the next layer in the path or the meaning of the string. Therefore, the correct method should be com \ mypackage \ XXX. xml.
B. For example, if we are familiar with \ n and line breaks, if we press enter directly in the middle of the string, Java will not perform line breaks on the string, because he doesn't know if you want to write the code in two lines or split the string into two lines for display, you need to add \ n escape characters in the middle of the string to wrap the string.
C. Take output as an example: the Java say: "Hello world! ". Double quotation marks indicate strings in Java. If they are not escaped, they cannot be output,
Therefore, the escape character system. Out. Print ("the Java say: \" Hello world \ ") is used to output double quotation marks.
Javascript Escape Character
Escape Sequence |
Character |
\ B |
Return |
\ F |
Take the form of paper |
\ N |
Line feed |
\ R |
Enter |
\ T |
Horizontal hop (CTRL-I) |
\' |
Single quotes |
\" |
Double quotation marks |
\\ |
Backslash |
Pay attention to special characters during programming. Many running problems are caused by special characters.
Note: Because the backslash itself is used as an escape character, you cannot directly type A backslash in the script. To generate a backslash, you must enter two backslash (\) together (\\).