Method TryParseUri
- Namespace
- SodaFlow.Functional
- Assembly
- SodaFlow.Functional.dll
TryParseUri(string?)
Parses an absolute Uri from this string, if it holds one.
[Pure]
public static Maybe<Uri> TryParseUri(this string? value)
Parameters
Returns
- Maybe<Uri>
A Maybe<T> containing the parsed value, and one containing no value if
valuedoes not hold an absolute URI.
Remarks
Wraps TryCreate(string, UriKind, out Uri) with Absolute. Use TryParseUri(string?, UriKind) to accept a relative one.
TryParseUri(string?, UriKind)
Parses a Uri of the given type from this string, if it holds one.
[Pure]
public static Maybe<Uri> TryParseUri(this string? value, UriKind uriKind)
Parameters
valuestringThe string to parse. A null string gives no value.
uriKindUriKindThe permitted type: absolute, relative, or one of the two.
Returns
- Maybe<Uri>
A Maybe<T> containing the parsed value, and one containing no value if
valuedoes not hold a URI of that type.