StringExtensions.AsBool 方法

定义

重载

AsBool(String)

将字符串转换为布尔值 (true/false)。

AsBool(String, Boolean)

将字符串转换为布尔值 (true/false),并指定默认值。

AsBool(String)

将字符串转换为布尔值 (true/false)。

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

参数

value
String

要转换的值。

返回

转换后的值。

适用于

AsBool(String, Boolean)

将字符串转换为布尔值 (true/false),并指定默认值。

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

参数

value
String

要转换的值。

defaultValue
Boolean

如果 value 为 null 或 为无效值,则返回的值。

返回

转换后的值。

适用于