Conversions.ToBoolean Method

Definition

Converts the specified object to a Boolean value.

Overloads

ToBoolean(Object)

Converts an object to a Boolean value.

ToBoolean(String)

Converts a string to a Boolean value.

ToBoolean(Object)

Source:
Conversions.vb
Source:
Conversions.vb
Source:
Conversions.vb

Converts an object to a Boolean value.

C#
public static bool ToBoolean(object Value);
C#
public static bool ToBoolean(object? Value);

Parameters

Value
Object

The object to convert.

Returns

A Boolean value. Returns False if the object is null; otherwise, True.

Applies to

.NET 10 ja muut versiot
Tuote Versiot
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
UWP 10.0

ToBoolean(String)

Source:
Conversions.vb
Source:
Conversions.vb
Source:
Conversions.vb

Converts a string to a Boolean value.

C#
public static bool ToBoolean(string Value);
C#
public static bool ToBoolean(string? Value);

Parameters

Value
String

The string to convert.

Returns

A Boolean value. Returns False if the string is null; otherwise, True.

Applies to

.NET 10 ja muut versiot
Tuote Versiot
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
UWP 10.0