ToBoolean Method

XmlConvert.ToBoolean Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft