Convert variable to type only known at run-time?
<pre><code>foreach (var filter in filters)
{
    var filterType = typeof(Filters);
    var method = filterType.GetMethod(filter, BindingFlags.IgnoreCase | BindingFlags.Public | BindingFlags.Static);
    if (method != null)
    {
        var parameters = method.GetParameters();
        Type paramType = parameters[0].GetType();
        value = (string)method.Invoke(null, new[] { value });
    }
}
</code></pre>

<p>How can I cast <code>value</code> to <code>paramType</code>? <code>value</code> is a <code>string</code>, <code>paramType</code> will probably just be a basic type like <code>int</code>, <code>string</code>, or maybe <code>float</code>. I'm cool with it throwing an exception if no conversion is possible.</p>
