Can .NET convert "Yes" & "No" to boolean without If?
- by hawbsl
You would think there would be a way using DirectCast, TryCast, CType etc but all of them seem to choke on it e.g.:
CType("Yes", Boolean)
You get:
System.InvalidCastException -
Conversion from string "Yes" to type
'Boolean' is not valid.