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
Returns
- Maybe<bool>
A Maybe<T> containing the parsed value, and one containing no value if
valuedoes 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.