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 或為無效值,則傳回的值。

傳回

轉換的值。

適用於