C # language escape characters (\xhhhh and \UDDDD)

Source: Internet
Author: User

The C # language transit character is not the same as the escape characters of the C + + language, but some are generic. The escape characters in the C # language are as follows (perhaps less complete, this is a summary of personal practice, and many of the articles reproduced on the web are confusing with the escape characters in C + +.) )
\ ' (single quotation mark 0x0027)
\ "(double quote 0x0022)
\ \ (backslash 0x005c)
(Null character 0x0000)
\a (Making a sound bell 0x0007)
\b (backspace 0x0008)
\ n (newline 0x000a)
\ r (carriage return 0x000d)
\xhhhh (HHHH is a hexadecimal encoding for characters, which can be up to 4 digits, not 4 digits, and the principle is 1-4 bits.) Most of the time, however, the characters following the \x will automatically take 4 digits between 0-9 or a-f/a-f. That is to say: (1) A character end escape with the first range not 0-9 or a-f/a-f is encountered, (2) a 4-digit end Escape is reached, (3) if the first character after \x does not meet 0-9 or a-f/a-f the compilation does not pass (VS2008).
\uhhhh (HHHH for hexadecimal Unicode character encoding, char in C # two bytes, hhhh must take 4 digits)

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.