StringExtensions.AsBool 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
AsBool(String) |
將字串轉換成布林 (true/false) 值。 |
AsBool(String, Boolean) |
將字串轉換成布林 (true/false) 值並指定預設值。 |
AsBool(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 或為無效值,則傳回的值。
傳回
轉換的值。