The escape character "\" in the Java string

Source: Internet
Author: User
In the Java string, if a slash appears,
1, as the escape character "\", the following must be followed by octal digits for ASCII escape output into other characters,
2, as a string slash direct output, you must use the double slash "\" escaped as a single slash

ASCII Reference octal table:
Https://baike.baidu.com/item/ASCII/309296?fr=aladdin

A special point in Java is: Str.split ("Sep", limit) function
The 1th parameter of the seperator delimiter string is to be parsed by the regular, so a special delimiter character is encountered and needs to be escaped again, for example. + ? * \:
. ---------- "\\."

+ ---------- "\\+"

? ---------- "\\?"

* ---------- "\\*"

\ ---------- "\\\\"

The escape character "\" in the Java string

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.