Table of Contents

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

value string

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

Returns

Maybe<TimeSpan>

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

value string

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

provider IFormatProvider

The formatting information of the culture to read with.

Returns

Maybe<TimeSpan>

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

Remarks