CTS,. netframeworkcts in. NET FrameWork
CTS: Common Type System general Type System.
1. Not only can C # be compiled into. Net IL, but also supports Basic, Python, Ruby and other languages, and even Java. Data Types in different languages are defined differently.. Net defines general data types (CTS, Common Type System): String, Int16, Int32, Int64, Boolean, and Double. By going to the definition, we can see that these are all classes (struct ).
2. Int64 → long, Int32 → int, Int16 → short, String → string, Boolean → bool.
Each language defines its own type.. Net provides a public type through CTS, and then translates the corresponding. Net type.
3. C # The original types such as string, int, long, bool, and double are defined in the language specification. the compiler translates these types into CTS classes. Through decompilation, we can see IL.
4. string is the class in c #, and String is the class of. net Framework CTS.
C # string ing is the String of. net Framework.
If a string is used, the compiler will compile it into a String. Therefore, if a String is used directly, the compiler will do less work.
If c # is used, we recommend that you use string to conform to the standard.