Converts the specified string representation of a logical value to its Boolean equivalent, using the specified culture-specific formatting information.
- value
- A string that contains the value of either bool.TrueString or bool.FalseString.
- provider
- An object that supplies culture-specific formatting information. This parameter is ignored.
true if value equals bool.TrueString, or false if value equals bool.FalseString or null.
If you prefer not to handle an exception if the conversion fails, you can call the bool.TryParse(string, Boolean@) method instead. It returns a bool value that indicates whether the conversion succeeded or failed.