Method TryParseTimeSpan
- Namespace
- SodaFlow.Functional
- Assembly
- SodaFlow.Functional.dll
TryParseTimeSpan(string?)
Parses a TimeSpan from this string, if it holds one.
[Pure]
public static Maybe<TimeSpan> TryParseTimeSpan(this string? value)
Parameters
Returns
- Maybe<TimeSpan>
A Maybe<T> containing the parsed value, and one containing no value if
valuedoes not hold one.
Remarks
Wraps TryParse(string, out TimeSpan), so this reads the current culture.
TryParseTimeSpan(string?, IFormatProvider)
Parses a TimeSpan from this string in the given culture, if it holds one.
[Pure]
public static Maybe<TimeSpan> TryParseTimeSpan(this string? value, IFormatProvider provider)
Parameters
valuestringThe string to parse. A null string gives no value.
providerIFormatProviderThe formatting information of the culture to read with.
Returns
- Maybe<TimeSpan>
A Maybe<T> containing the parsed value, and one containing no value if
valuedoes not hold one.