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 或 为无效值,则返回的值。
返回
转换后的值。