I\'m just learning about generics and have a question regarding method return values.
Say, I want a generic method in the sense that the required generic part of the
Something like this?
void Main() { int iIntVal = ConvertTo("10"); double dDoubleVal = ConvertTo("10.42"); } public T ConvertTo(string val) where T: struct { return (T) System.Convert.ChangeType(val, Type.GetTypeCode(typeof(T))); }