I want to convert a C# style generic type string, like
"System.Dictionary<System.String, System.String>"
to it's CLR equivalent:
"System.Dictionary`1[System.String, System.String]"
and back. Is there an easy way to do this, or do I have to resort to string manipulation?
EDIT: I only have the string representation in C#/VB/etc style form. I don't have a Type object or something similar at hand. An alternate question would have been: how to get a Type object from a string representation like "System.Dictionary<System.String, System.String>"
(after that I can get the full name of the type object)
EDIT2: justification: I'm creating objects dinamically using CodeDom
. The input from which I'm generating the CodeDom
might contain types in C#
(or any other proprietary like VB.NET) format, but I have to use them inside a CodeTypeReference
, which only accepts the CLR style format.