The ASCII No. 160th space of the wonderful flower

Source: Internet
Author: User

It's so weird. The printed name is a space, or trim () is used. For the first time, I know there are 160th spaces.

Let's see the code.

  1. System.out.println(StringEscapeUtils.unescapeHtml4(" ").equals(" "));
  2. System.out.println((int)StringEscapeUtils.unescapeHtml4(" ").charAt(0));
  3. System.out.println((int)‘ ‘);

Output:

    1. false
    2. 160
    3. 32
The original usually see is 32nd number of space Ah!!Web page   at the time of submission to the server, the Java String trim method can only handle ASCII 32 spaces, and we need to use Text.replaceall ("[\\s\\u00a0]+$", "" ") to remove spaces.  The ASCII code 0 prints out also a space.
  It's the number 160th space. The normal 32nd blank will be compressed into a continuous space on the Web page, to indicate that a continuous space can only use this. If you use XHTML and do not define    (not a standard XML entity), it is necessary to use & #160; See: Http://en.wikipedia.org/wiki/Character_entity_reference



From for notes (Wiz)



The ASCII No. 160th space of the wonderful flower

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.