Asp.net common charipet fields and static methods

Source: Internet
Author: User

/* 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;
}

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.