How i can get full right name of generic type?
For example: This code
typeof(List).Name
return
If you have an instance of the list, you can call .ToString() and get the following
System.Collections.Generic.List`1[System.String]
This is in addition to the methods provided by the other answers directly against the type rather than the instance.
Edit: On your edit, I do not believe it is possible without providing your own parsing method, as List
is C# shorthand for how the type is implemented, sort of like if you wrote typeof(int).ToString()
, what is captured is not "int" but the CTS name, System.Int32.