StringExtensions.AsBool Method

Include Protected Members
Include Inherited Members

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

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

Overload List

  Name Description
Public methodStatic member AsBool(String) Converts a string to a Boolean (true/false) value.
Public methodStatic member AsBool(String, Boolean) Converts a string to a Boolean (true/false) value and specifies a default value.

Top

Remarks

Use the AsBool methods to convert the string values "true" or "false" (case insensitive) to Boolean values. The methods do not convert numeric string values such as 0 or 1. Before you try to convert, you can check whether the string can be converted to this type by calling the IsBool(String) method, which returns true if the string value can be converted.

See Also

Reference

StringExtensions Class

System.Web.WebPages Namespace