Click or drag to resize
ConvertToBoolean Method (String, IFormatProvider)
Converts the specified string representation of a logical value to its Boolean equivalent, using the specified culture-specific formatting information.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public static bool ToBoolean(
	string value,
	IFormatProvider provider
)

Parameters

value
Type: SystemString
A string that contains the value of either TrueString or FalseString.
provider
Type: SystemIFormatProvider
An object that supplies culture-specific formatting information. This parameter is ignored.

Return Value

Type: Boolean
true if value equals TrueString, or false if value equals FalseString or null.
Exceptions
ExceptionCondition
FormatExceptionvalue is not equal to TrueString or FalseString.
See Also