title: Convert string to generic type c# (Convert string to T)
body: <p>I have a method that needs to convert a string to the generic type:</p>
  
  <pre><code>T GetValue&lt;T&gt;(string name)
  {
     string item = getstuff(name);
     return item converted to T   // ????????
  }
  </code></pre>
  
  <p>T could be int or date.</p>