Let's say I have:
string ValueToCastTo;
object TheThing;
If ValueToCastTo
is set to "int"
, I want TheThing
to be casted to an int
.
If ValueToCastTo
is set to "DateTime"
, I want TheThing
to be casted to a DateTime
.
I can't use if
statements because the string could be set to anything.
Thanks.