Special characters in C #

Source: Internet
Author: User

Special Character c #
C # Language specifications-2.4.4.4 characters
Author: unknown updated on:

A character represents a single character, usually composed of one character placed in quotation marks, such as 'A '.

Character-literal :( character :)
'Character' ('characters ')
Character :( character :)
Single-character (single character)
Simple-escape-sequence (simple escape sequence)
Hexadecimal-escape-sequence (hexadecimal escape sequence)
Unicode-escape-sequence (unicode escape sequence)
Single-character :( single character :)
Any character except '(U + 0027),/(U + 005C), and linefeed
Simple-escape-sequence: one of (simple escape sequence: one of the following)
/'/"// 0/a/B/f/n/r/t/v
Hexadecimal-escape-sequence :( hexadecimal escape sequence :)
/X hex-digit hex-digitopt (/x hexadecimal number optional)
The character followed by the backslash (/) must be one of the following: ', ",/, 0, a, B, f, n, r, t, u, U, x, v. Otherwise, a compilation error occurs.

The hexadecimal escape sequence represents a single Unicode character. Its value consists of "/x" followed by a hexadecimal number.

If the value of a character is greater than U + FFFF, a compile-time error occurs.

The Unicode Character escape sequence (Section 2.4.1) must be in the range of U + 0000 to U + FFFF.

A simple escape sequence represents a Unicode character encoding. See the following table.

Escape Sequence character name Unicode encoding
/'
Single quotes 0x0027

/"
Double quotation marks 0x0022

//
Backslash 0x005C

/0
Null 0x0000

/
Alert 0x0007

/B
Returns 0x0008

/F
Page feed 0x000C

/N
Linefeed 0x000A

/R
Enter 0x000D

/T
Horizontal tab 0x0009

/V
Vertical tab 0x000B

The "character" type is char.

Related Article

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.