Also, Convert.ToBoolean is already built in with overload support for different input types & formats.
If you're doing tons of conversions and concerned about having Convert. littering your code, add a using static System.Convert; to your using statements to import all of the static methods of the type so that you can call them as if they were a static function local to your type, e.g. ToBoolean(input), ToUInt64(input), FromBase64String(input), etc.
17
u/thatwasagoodyear Dec 20 '20
Also,
Convert.ToBooleanis already built in with overload support for different input types & formats.If you're doing tons of conversions and concerned about having
Convert.littering your code, add ausing static System.Convert;to your using statements to import all of the static methods of the type so that you can call them as if they were a static function local to your type, e.g.ToBoolean(input),ToUInt64(input),FromBase64String(input), etc.