Table of Contents

ToUri Method

Definition

Namespace
Cuemon.Extensions
Assemblies
Cuemon.Extensions.Core.dll
Source
src/Cuemon.Extensions.Core/StringExtensions.cs

ToUri(string, UriKind)

Converts the specified value to its equivalent Uri representation.

public static Uri ToUri(this string value, UriKind uriKind = UriKind.Absolute)

Parameters

value string

The string to extend.

uriKind UriKind

Specifies whether the URI string is a relative URI, absolute URI, or is indeterminate.

Returns

Uri

A Uri that corresponds to value and uriKind.

Exceptions

ArgumentNullException

value cannot be null.

ArgumentException

value cannot be empty or consist only of white-space characters.