Converts a string to a boolean value.
[Visual Basic] Public Shared Function ToBoolean( _ ByVal value As String _ ) As Boolean [C#] public static bool ToBoolean( string value ); [C++] public: static bool ToBoolean( String* value ); [JScript] public static function ToBoolean( value : String ) : Boolean;
The boolean value true if the given string is "true" or "1", or the boolean value false if the given string is "false" or "0".
Exception Type | Condition |
---|---|
XmlException | If the given string is not "true", "false", "1", or "0". |
XmlString Class | XmlString Members | System.Xml Namespace | FromBoolean