11.1 Characters
char,16 bit Unicode code value
Two constant fields, Char.minvalue: Defined as ' "; Char. MaxValue: Defined as ' \uffff ';
Char.getunicodecategory () method, return character type (currency/punctuation/math symbols, etc.)
The transformation between Char and Int32:
11.2 String
Can only be string s = "Jax", and cannot use new to establish a string
The above statement, in IL, is not newobj, but ldstr: Because the string is a constant, it cannot be changed immutable
You can use the + operator to concatenate several strings, connect at compile time, and generate a string constant. Avoid connecting at runtime--this time using StringBuilder
Verbatim string verbatim strings, that is, @ "XXX"
Compare strings using String.Compare () or string.equals ()
Use ToUpper () instead of tolower before comparing because the former is better than the latter
The string is retained, is a string warehouse, generally do not use this technique: System.intern ()
11.3 StringBuilder
There's a char array field inside the StringBuilder, and we're manipulating this field, plus a ToString () method that returns a string of character arrays.
Exceeding the capacity will allocate a larger array, copy the characters, use this new array, and the previous array will be garbage collected
11.5 Parse string to get an object
Static Parse () method, gets the string argument, returns the corresponding instance-this is a factory
In FCL, all numeric type/datetime/timespan provide parse methods, such as:
Int32 x = Int32.Parse ("123");