Tries to convert the specified string representation of a logical value to its Boolean equivalent. A return value indicates whether the conversion succeeded or failed.
Assembly: mscorlib (in mscorlib.dll)
- Type: System::String
A string containing the value to convert.
- Type: System::Boolean%
When this method returns, if the conversion succeeded, contains true if value is equal to Boolean::TrueString or false if value is equal to FalseString. If the conversion failed, contains false. The conversion fails if value is nullptr or is not equal to the value of either the TrueString or FalseString field.
Return ValueType: System::Boolean
true if value was converted successfully; otherwise, false.
The method is like the Parse method, except the method does not throw an exception if the conversion fails.
The value parameter can be preceded or followed by white space. The comparison is ordinal and case-insensitive.
The following example calls the method to parse an array of strings. Note that the parse operation succeeds only if the string to be parsed is "True" (the value of the TrueString field) or "False" (the value of the FalseString field) in a case-insensitive comparison.
.NET FrameworkSupported in: 4.5, 4, 3.5, 3.0, 2.0
.NET Framework Client ProfileSupported in: 4, 3.5 SP1
Portable Class LibrarySupported in: Portable Class Library
.NET for Windows Store appsSupported in: Windows 8
.NET for Windows Phone appsSupported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8
Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.