The content of this section:
1: Definition of character
2: Method of the character
3: Escape character
4: Introduction to Strings
5: String method
1: Definition of character
Char corresponds to Unicode one by one, with a char of 2 bytes.
2: How to use the characters:
Instance:
Static voidMain () {CharA ='a'; Charb ='0'; Charc ='A'; if(Char. Isletter (a)) {//Judgment lowercase Console.WriteLine ("A is {0} lowercase, and uppercase is {1}"AChar. ToUpper (a)); } if(Char. IsDigit (b)) {//Determine if the data is Console.WriteLine ("B is the {0} number;", B); } Console.WriteLine (Char. ToLower (c)); Convert to lowercase console.readkey (); }3: Escape character
4: Introduction to Strings
Character set and character encoding relationships:
Commonly used character sets and character encodings:
View of the ASCII code table:
5: Method of String
1: Convert String to Size
static void Main () { string res = "Jack"; char S1 = ' s '; Console.WriteLine (Res. ToUpper()); The string becomes uppercase Console.WriteLine (Char. ToUpper(S1)); The character becomes capitalized Console.readkey (); }
2: Comparison of strings
Method:
1: = =
2:string.equals (ARG1,ARG2) # #返回布尔值
3:string.compare (Arg1,arg2,[true|false]) # #可选的是true or False indicates whether the case of a character can be ignored
namespaceHelloWorld {classHello {Static voidMain () {stringres ="Jack"; stringRes2 ="Jack"; Console.WriteLine (string. Equals (Res,res2)); Console.WriteLine (string. Compare (Res,res2)); Console.readkey (); } }}//true//0
Description under: Compare Method:
C # 14th character method, escape character, String method