/* Constant field */
Maxvalue // 65535
Minvalue // 0
/* Static method */
Char. convertfromutf32 () // Convert unicode value to string
Char. converttoutf32 () // convert to the unicode value
Char. equals () // =
Char. getnumericvalue () // numeric character to the corresponding value, return type is double
Char. getunicodecategory () // Obtain the character category
Char. iscontrol ()//? Control characters
Char. isdigit ()//? Decimal number (0 .. 9)
Char. ishighsurrogate ()//? High proxy code bit (u + d800... u + dbff)
Char. isletter ()//? Letter
Char. isletterordigit ()//? Letter or decimal number?
Char. islower ()//? Lowercase letters (a. z, etc)
Char. islowsurrogate ()//? High proxy code bit (u + dc00... u + dfff)
Char. isnumber ()//? Number (0 .. 9, etc)
Char. ispunctuation ()//? Punctuation?
Char. isseparator ()//? Separator (space, etc)
Char. issurrogate ()//? Agent item code bit
Char. Issurrow.pair () // determine whether two char objects form a proxy
Char. issymbol ()//? Symbol ($ + = <> ^ '|, etc)
Char. isupper ()//? Uppercase letters (a. z)
Char. iswhitespace ()//? Blank
Char. parse () // Convert single-character string to char
Char. tolower () // Convert to lowercase
Char. tolowerinvariant () // Convert to lowercase, using regional rules
Char. tostring ()//
Char. toupper () // Convert to uppercase
Char. toupperinvariant () // Convert to uppercase, using regional rules
Char. tryparse () // try to convert the string to char of a single character
/* Object method */
Compareto () // comparison, returns an integer representing the distance
--------------------------------------------------------------------------------
Getnumericvalue ():
--------------------------------------------------------------------------------
Protected void button#click (object sender, eventargs e)
{
Double f1 = char. getnumericvalue ('9'); // 9
Double f2 = char. getnumericvalue ('A'); //-1
Double f3 = char. getnumericvalue ('wan'); //-1
Double f4 = char. getnumericvalue ("a1b2", 3); // 2
Textbox1.text = string. concat (f1, "n", f2, "n", f3, "n", f4 );
}
--------------------------------------------------------------------------------
Convertfromutf32 (), converttoutf32 ():
--------------------------------------------------------------------------------
Protected void button#click (object sender, eventargs e)
{
String s1 = char. convertfromutf32 (65); //
String s2 = char. convertfromutf32 (0x4e07); // 10 thousand
Int n1 = char. converttoutf32 ("abc", 1); // 66
Int n2 = char. converttoutf32 ("Ten Thousand", 0); // 19975
Textbox1.text = string. concat (s1, "n", s2, "n", n1, "n", n2 );
}
--------------------------------------------------------------------------------
Getunicodecategory ():
--------------------------------------------------------------------------------
Protected void button#click (object sender, eventargs e)
{
Char c;
String str = "";
For (int I = 20; I <256; I ++)
{
C = convert. tochar (I );
Str + = string. format ("{0} t {1} t {2} n", I, c, char. getunicodecategory (c ));
}
Textbox1.text = str;
}