C# How can I get Type from a string representation
<p>I have <code>MyClass&lt;T&gt;</code>.</p>

<p>And then I have this <code>string s = "MyClass&lt;AnotherClass&gt;";</code><br />
How can I get Type from the string s ?</p>

<p>One way (ugly) is to parse out the "&lt;" and ">" and do: </p>

<pre><code>Type acType = Type.GetType("AnotherClass");  
Type whatIwant = typeof (MyClass&lt;&gt;).MakeGenericType(acType);
</code></pre>

<p>But is there a cleaner way to get the final type without any parsing etc. ?
Thanks.</p>
