Table of Contents

Method TryParseBoolean

Namespace
SodaFlow.Functional
Assembly
SodaFlow.Functional.dll

TryParseBoolean(string?)

Parses a bool from this string, if it holds one.

[Pure]
public static Maybe<bool> TryParseBoolean(this string? value)

Parameters

value string

The string to parse. A null string gives no value.

Returns

Maybe<bool>

A Maybe<T> containing the parsed value, and one containing no value if value does not hold one.

Remarks

Wraps TryParse(string, out bool), which accepts only True and False in any casing, and whitespace on each side is correct. It does not accept 1, 0, yes or no, and is not culture-sensitive.