Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Boolean.Parse Method (String)


Converts the specified string representation of a logical value to its Boolean equivalent.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

public static bool Parse(
	string value


Type: System.String

A string containing the value to convert.

Return Value

Type: System.Boolean

true if value is equivalent to TrueString; false if value is equivalent to FalseString.

Exception Condition

value is null.


value is not equivalent to TrueString or FalseString.

The value parameter, optionally preceded or trailed by white space, must contain either TrueString or FalseString; otherwise, an exception is thrown. The comparison is case-insensitive.

The following code example illustrates the use of Parse method.

bool val;
string input;

input = bool.TrueString;
val = bool.Parse(input);
Console.WriteLine("'{0}' parsed as {1}", input, val);
// The example displays the following output:
//       'True' parsed as True        

Change History




June 2010

Corrected return value information.

Customer feedback.

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft