Returns the specified string converted to a bool
value.
[Edit]
Parameters
- value
- A string containing the value to convert. The string is equivalent to either bool.TrueString or bool.FalseString, can contain leading and/or trailing whitespace, and is parsed in a case-insensitive manner.
[Edit]
Returns
true if value is equivalent to
bool.TrueString; otherwise, false .
[Edit]
Exceptions
Remarks
Example
The following example demonstrates the bool.Parse(string) method.
C# Example |
using System;
public class BoolParse {
public static void Main() {
Boolean b = Boolean.Parse(" true ");
Console.WriteLine("\" true \" parses to \"{0}\".", b);
}
}
|
The output is
" true "
parses to "True".
Requirements
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0