XmlConvert.ToBoolean Method

Converts the String to a Boolean equivalent.

Namespace:  System.Xml
Assembly:  System.Xml (in System.Xml.dll)

public static bool ToBoolean(
	string s
)

Parameters

s
Type: System.String
The string to convert.

Return Value

Type: System.Boolean
A Boolean value, that is, true or false.

ExceptionCondition
NullReferenceException

s is null.

FormatException

s does not represent a Boolean value.

Valid strings are "1" or "true" for true and "0" or "false" for false.

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show: