Click or drag to resize
BooleanTryParse Method
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.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public static bool TryParse(
	string value,
	out bool result
)

Parameters

value
Type: SystemString
A string containing the value to convert.
result
Type: SystemBoolean
When this method returns, if the conversion succeeded, contains true if value is equivalent to TrueString or false if value is equivalent to FalseString. If the conversion failed, contains false. The conversion fails if value is null or is not equivalent to the value of either the TrueString or FalseString field.

Return Value

Type: Boolean
true if value was converted successfully; otherwise, false.
See Also