Possible Duplicate:
is there a generic Parse() function that will convert a string to any type using parse?
I want to make a generic function for doing some operations, like:
ConvertValue<T>(string value)
If T is int then the function will convert the value to int and return the result.
Similarly, if T is boolean, the function will convert the value to boolean and return it.
How to write this?