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