NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Boolean.FromString

Converts the "true" and "false" strings to Boolean true and false values, respectively.

[Visual Basic]
Public Shared Function FromString( _
   ByVal value As String _
) As Boolean
[C#]
public static bool FromString(
   string value
);
[C++]
public: static bool FromString(
   String* value
);
[JScript]
public static function FromString(
   value : String
) : Boolean;

Parameters

value
A string to be converted.

Return Value

A true or false Boolean value.

Exceptions

Exception Type Condition
ArgumentException If the string is null.
FormatException If the string does not match.

Remarks

The FromString method provides a means of changing true and false strings to Boolean values.

The string parameter must provide a case-insensitive match with either "true" or "false". Leading and trailing white space is allowed and ignored.

The return value is a true Boolean value if the value is a case-insensitive match for "true", or a "false" Boolean value if it is a case-insensitive match for "false".

If the return valuedoes not match "true" or "false", then an exception is thrown. It will ignore the case of the text, as well as leading or trailing white space.

See Also

Boolean Structure | Boolean Members | System Namespace