I\'m trying to convert the value \"0\"
( System.String
) to its Boolean
representation, like:
var myValue = Convert.To
For a successful conversion to occur, the value parameter must equal either Boolean.TrueString, a constant whose value is True
, Boolean.FalseString, a constant whose value is False
, or it must be null. In comparing value with Boolean.TrueString and Boolean.FalseString, the method ignores case as well as leading and trailing white space.
from MSDN
because Convert.ToBoolean
expects a true if value is not zero; otherwise, false. numerical value and True
or False
String
value.