Home  >  Article  >  Backend Development  >  Detailed introduction to the use of character class char in C# language summary

Detailed introduction to the use of character class char in C# language summary

黄舟
黄舟Original
2017-03-29 11:12:331779browse

The following editor will bring you an article on how to use the character classchar in the C# language (summary). The editor thinks it is quite good, so I will share it with you now and give it as a reference for everyone. Let’s follow the editor and take a look.

The char class represents a unicode character in C#. It is these unicode characters that constitute the string. Unicode characters are currently a common character encoding in computers. It sets a unified binary encoding for each character in different languages ​​and is used to meet cross-language and cross-platform text conversion and processing requirements. The definition of char is very simple, as follows:

char ch1=‘z’;

However, char can only define one unicode character.

The following are common usage methods and instructions of the char class

iscontrol Indicates whether the specified unicode character is a control character Category

isdigit Indicates whether a certain unicode character belongs to the decimal digit category

ishighsurrogate Indicates the specified charObjectWhether it is a high surrogate item

isletter Indicates whether a certain unicode character belongs to the alphabetic category

isletterordigit Indicates whether a unicode character belongs to the alphabetical category or the decimal numeric category

islower Indicates whether a unicode character belongs to the lowercase alphabetic category

islowsurrogate Indicates whether the specified char object is a low surrogate item

isnumber Indicates whether a certain unicode character belongs to the numeric category

ispunctuation Indicates a certain Whether a unicode character belongs to the punctuation mark category

isseparator Indicates whether a unicode character belongs to the separator category

issurrogate Indicates whether a unicode character Belongs to surrogate characters

issurrogatepair Indicates whether two specified char objects form

issymbol Indicates whether a certain unicode character belongs to the symbol category

isupper Indicates whether a certain unicode character belongs to the uppercase category

iswhitespace Indicates whether a certain unicode character belongs to the whitespace category

parse Convert the value of the specified string to its equivalent unicode character

tolower Convert the value of the unicode string to its lowercase equivalent

tolowerinvariant Convert the value of a unicode character to its lowercase equivalent using the fixed culture's case rules

tostring Convert the value of this instance to Its equivalent string representation

toupper Converts the value of a unicode character to its uppercase equivalent

toupperinvariant Use a fixed culture Converts the value of a unicode character to its uppercase equivalent using the case rules

tryparse Converts the value of the specified string to its equivalent unicode character

The following are common escape characters in C

#\n Carriage return and line feed

\f Page feed

\t Horizontal jump to the next tab position

\\ Backslash character

\v Vertical tab

\' Single quote character

\b Backspace

\ddd Characters represented by 1~3 octal digits

\r Enter

\xhh 1~2 hexadecimal digits The character represented by the number

The above is the detailed content of Detailed introduction to the use of character class char in C# language summary. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn