C # Unicode character escape sequence

Source: Internet
Author: User

The escape sequence of Unicode characters represents a Unicode character. Unicode-escape-sequence: (Unicode escape sequence:)
/u hex-digit hex-digit hex-digit hex-digit (/u hexadecimal digit hexadecimal digit hexadecimal digit hexadecimal digit)
/u hex-digit hex-digit hex-digit hex-digit hex-digit hex-digit hex-digit hex-digit (/u hexadecimal digit hexadecimal digits hexadecimal digit hexadecimal digit hexadecimal digit hexadecimal digit hex number hex digit
The Unicode escape sequence represents a single Unicode character that consists of hexadecimal digits following the "/U" or "/U" characters. Because C # uses the 16-bit encoding of Unicode code points in character and string values, Unicode characters from u+10000 to u+10ffff cannot be used in characters and are represented in strings with a Unicode surrogate pair. Unicode characters above 0x10ffff are not supported for code data points.
Do not perform multiple conversions. For example, the string "/u005cu005c" is equivalent to "/u005c" instead of "/". Unicode value/u005c is the character "/".
Example
Class Class1
{
static void Test (bool/u0066) {
char c = '/u0066 ';
if (/u0066)
System.Console.WriteLine (C.tostring ());
}
}
Shows some uses of/u0066, which is the escape sequence of the letter "F". This program is equivalent to
Class Class1
{
static void Test (bool f) {
char C = ' F ';
if (f)
System.Console.WriteLine (C.tostring ());
}
}

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.