Redigera

Dela via


XmlConvert.ToBoolean(String) Method

Definition

Converts the String to a Boolean equivalent.

public:
 static bool ToBoolean(System::String ^ s);
public static bool ToBoolean (string s);
static member ToBoolean : string -> bool
Public Shared Function ToBoolean (s As String) As Boolean

Parameters

s
String

The string to convert.

Returns

A Boolean value, that is, true or false.

Exceptions

s does not represent a Boolean value.

Remarks

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

Applies to