If you want to test if a string is a valid Boolean without any thrown exceptions you can try this :
string stringToBool1 = "true";
string stringToBool2 = "1";
bool value1;
if(bool.TryParse(stringToBool1, out value1))
{
MessageBox.Show(stringToBool1 + " is Boolean");
}
else
{
MessageBox.Show(stringToBool1 + " is not Boolean");
}
outputis Boolean
and the output for stringToBool2 is : 'is not Boolean'