Convert.ToBoolean Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Converts values to Boolean structures.
Overloads
ToBoolean(Object) |
This API supports the product infrastructure and is not intended to be used directly from your code. |
ToBoolean(Object, Boolean) |
This API supports the product infrastructure and is not intended to be used directly from your code. Converts the specified Object value to a Boolean structure, optionally allowing data loss. |
ToBoolean(Double) |
This API supports the product infrastructure and is not intended to be used directly from your code. |
ToBoolean(Object)
ToBoolean(Object, Boolean)
public:
static bool ToBoolean(System::Object ^ value, bool explicitConversion);
public static bool ToBoolean (object value, bool explicitConversion);
static member ToBoolean : obj * bool -> bool
Public Shared Function ToBoolean (value As Object, explicitConversion As Boolean) As Boolean
Parameters
- value
- Object
The value to convert.
- explicitConversion
- Boolean
true
to allow data loss; otherwise, false
.
Returns
value
converted to a Boolean.
Applies to
ToBoolean(Double)
public:
static bool ToBoolean(double d);
public static bool ToBoolean (double d);
static member ToBoolean : double -> bool
Public Shared Function ToBoolean (d As Double) As Boolean
Parameters
- d
- Double
The value to convert.
Returns
false
if d
is 0; otherwise, true
.