StringExtensions.AsBool Method

Definition

Overloads

AsBool(String)

Converts a string to a Boolean (true/false) value.

AsBool(String, Boolean)

Converts a string to a Boolean (true/false) value and specifies a default value.

AsBool(String)

Converts a string to a Boolean (true/false) value.

public static bool AsBool (this string value);
static member AsBool : string -> bool
<Extension()>
Public Function AsBool (value As String) As Boolean

Parameters

value
String

The value to convert.

Returns

The converted value.

Applies to

AsBool(String, Boolean)

Converts a string to a Boolean (true/false) value and specifies a default value.

public static bool AsBool (this string value, bool defaultValue);
static member AsBool : string * bool -> bool
<Extension()>
Public Function AsBool (value As String, defaultValue As Boolean) As Boolean

Parameters

value
String

The value to convert.

defaultValue
Boolean

The value to return if value is null or is an invalid value.

Returns

The converted value.

Applies to