Mono Class Library: System.Xml.XmlConvert Overview | Members

System.Xml.XmlConvert.ToBoolean Method

Converts a string to a bool equivalent. [Edit]

public static bool ToBoolean (string s)

Parameters

s
The string to convert. [Edit]

Returns

The bool equivalent of s. [Edit]

Exceptions

TypeReason
ArgumentNullExceptions is a null reference. [Edit]
FormatExceptions does not represent a bool value. [Edit]

Remarks

This method removes leading and trailing white space. After this trimming, valid strings are "1" and "true", which return true, and "0" and "false", which return false. [Edit]

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0