A summary of the use of character Char in the C # language is described in detail

Source: Internet
Author: User
The following small series for everyone to bring a C # language in the character class char use Method (summary). Small series feel very good, now share to everyone, also for everyone to make a reference. Let's take a look at it with a little knitting.

The Char class represents a Unicode character in C #, exactly the Unicode characters that make up a string. Unicode characters are the Universal character encoding of the current computer, which sets up a uniform binary encoding for each character in different languages, and is used to meet the requirements of text translation and processing across languages and platforms. The definition of char is very simple, as follows:

Char ch1= ' z ';

However, Char can only define one Unicode character.

The following are common methods and instructions for using CHAR classes

Iscontrol Indicates whether the specified Unicode character belongs to the control character category

isdigit Indicates whether a Unicode character belongs to a decimal number category

ishighsurrogate Indicates whether the specified Char object is a high surrogate

Isletter Indicates whether a Unicode character belongs to the letter category

Isletterordigit Indicates whether a Unicode character belongs to an alphabetic category or a decimal number category

islower Indicates whether a Unicode character belongs to a lowercase letter category

islowsurrogate Indicates whether the specified Char object is a low surrogate

Isnumber Indicates whether a Unicode character belongs to a numeric category

ispunctuation Indicates whether a Unicode character belongs to a punctuation category

IsSeparator Indicates whether a Unicode character belongs to a delimiter category

issurrogate Indicates whether a Unicode character belongs to a proxy character

Issurrogatepair Indicates whether the two specified char objects form a

Issymbol Indicates whether a Unicode character is part of a symbol category

Isupper Indicates whether a Unicode character belongs to an uppercase category

Iswhitespace Indicates whether a Unicode character belongs to a blank category

Parse Converts the value of the specified string to its equivalent Unicode character

ToLower Converts the value of a Unicode string to its lowercase equivalent

Tolowerinvariant Converts the value of a Unicode character to its lowercase equivalent using the casing rules of the invariant culture

ToString Converts the value of this instance to its equivalent string representation

ToUpper Converts the value of a Unicode character to its uppercase equivalent

Toupperinvariant Converts the value of a Unicode character to its uppercase equivalent using the casing rules of the invariant culture

TryParse Converts the value of the specified string to its equivalent Unicode character

The following are the common escape characters in C #

\ nthe carriage return to newline.

\f Page Change

\ t jumps horizontally to the next tab position

\ \ backslash Character

\v Vertical Jump Lattice

\ ' Single-quote character

\b Backspace

\DDD the character represented by the octal digit

\ r Enter

\xhh the characters represented by hexadecimal digits

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.