Type.GetType("System.String")
Is there a lookup for the aliases available somewhere?
Type.GetType("string")
returns null
.
This is not possible programmatically, since the 'aliases' are in fact keywords introduced in C#, and Type.GetType
(like every other framework method) is part of the language-independent framework.
You could create a dictionary with the following values:
bool System.Boolean
byte System.Byte
sbyte System.SByte
char System.Char
decimal System.Decimal
double System.Double
float System.Single
int System.Int32
uint System.UInt32
long System.Int64
ulong System.UInt64
object System.Object
short System.Int16
ushort System.UInt16
string System.String
The "aliases" are part of the language definition. You need to look them up in the language spec in question. They are compiled away, and don't exist at runtime - string becomes System.String, int becomes System.Int32, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With