System.Convert.ToBoolean Method

Converts the value of the specified object to an equivalent Boolean value, using the specified culture-specific formatting information.

Syntax

public static bool ToBoolean (object value, IFormatProvider provider)

Parameters

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

Returns

true or false, which reflects the value returned by invoking the IConvertible.ToBoolean(IFormatProvider) method for the underlying type of value. If value is null, the method returns false.

Remarks

provider enables the user to specify culture-specific conversion information about the contents of value. The base types ignore the provider parameter; however, the parameter may be used if value is a user-defined type that implements the IConvertible interface.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0