Tries to convert the specified string representation of a logical value to its Boolean equivalent. A return value indicates whether the conversion succeeded or failed.
Assembly: mscorlib (in mscorlib.dll)
- Type: System::String
A string containing the value to convert.
- Type: System::Boolean%
When this method returns, if the conversion succeeded, contains true if value is equal to Boolean::TrueString or false if value is equal to FalseString. If the conversion failed, contains false. The conversion fails if value is nullptr or is not equal to the value of either the TrueString or FalseString field.
Return ValueType: System::Boolean
true if value was converted successfully; otherwise, false.
The method is like the Parse method, except the method does not throw an exception if the conversion fails.
The value parameter can be preceded or followed by white space. The comparison is ordinal and case-insensitive.
The following example calls the method to parse an array of strings. Note that the parse operation succeeds only if the string to be parsed is "True" (the value of the TrueString field) or "False" (the value of the FalseString field) in a case-insensitive comparison.