Java Escape character (reprint)

Source: Internet
Author: User

Reprinted from: http://blog.163.com/[email protected]/blog/static/110479195200911229337281/

I. Why should I use escape characters?

1, the HTML <, >, & and so on have special meaning (<,>, for the link to sign,& for escaping), can not be used directly, These symbols are not displayed in the final page we see, that if we want to display these symbols in the Web page, Need to be Escaped.

2. The escape string (escape Sequence) is also called the character entity (Character entity). In html, there are two reasons for defining an escape character: first, the "<" and ">" class symbols are already used to represent HTML tags, so they cannot be used directly as symbols in Text. To use these symbols in an HTML document, you need to define their escape strings. When the interpreter encounters such a string, it interprets it as a real character. When entering an escape string, strictly follow the letter casing Rules. second, Some characters are not defined in the ASCII character set, so you need to use an escape string to represent Them.

Ii. common list of HTML escape characters

Most commonly used character entities
Description Entity number
Half-square-large Blank &ensp;
The whole square big blank &emsp;
Space &nbsp;
Less than &lt;
Greater than &gt;
& Symbols &amp;
Double quotes &quot;
Copyright &copy;
Multiplication sign &times;
Division Sign &divide;
Escape sequences
\b Backspace
\f Go paper Wrap
\ n Enter
\ r Line break
\ t Horizontal Jump Grid
\‘ Single quotation marks
\" Double quotes
\\ Back slash

Java Escape character (reprint)

Related Article

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.