Java Escape character

Source: Internet
Author: User

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

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.