Click or drag to resize
ConvertToBoolean Method (Object, IFormatProvider)
Converts the value of the specified object to an equivalent Boolean value, 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(
	Object value,
	IFormatProvider provider
)

Parameters

value
Type: SystemObject
An object that implements the IConvertible interface, or null.
provider
Type: SystemIFormatProvider
An object that supplies culture-specific formatting information.

Return Value

Type: Boolean
true or false, which reflects the value returned by invoking the ToBoolean(IFormatProvider) method for the underlying type of value. If value is null, the method returns false.
Exceptions
ExceptionCondition
FormatExceptionvalue is a string that does not equal TrueString or FalseString.
InvalidCastExceptionvalue does not implement the IConvertible interface.-or-The conversion of value to a Boolean is not supported.
See Also