Search Results for

    Show / Hide Table of Contents
    View Source

    Class UriUtilityCore

    Provides utility methods for working with URIs.

    Inheritance
    object
    Namespace: Umbraco.Cms.Core
    Assembly: Umbraco.Core.dll
    Syntax
    public static class UriUtilityCore

    Methods

    View Source

    EndPathWithSlash(string)

    Ensures the path portion of the URI ends with a slash.

    Declaration
    public static string EndPathWithSlash(string uri)
    Parameters
    Type Name Description
    string uri

    The URI string.

    Returns
    Type Description
    string

    The URI string with the path ending in a slash.

    View Source

    HasScheme(string)

    Determines whether the specified URI string contains a scheme (e.g., "http://").

    Declaration
    public static bool HasScheme(string uri)
    Parameters
    Type Name Description
    string uri

    The URI string to check.

    Returns
    Type Description
    bool

    true if the URI has a scheme; otherwise, false.

    View Source

    StartWithScheme(string)

    Ensures the URI string starts with a scheme, using HTTP as the default.

    Declaration
    public static string StartWithScheme(string uri)
    Parameters
    Type Name Description
    string uri

    The URI string.

    Returns
    Type Description
    string

    The URI string with a scheme prefix.

    View Source

    StartWithScheme(string, string?)

    Ensures the URI string starts with the specified scheme.

    Declaration
    public static string StartWithScheme(string uri, string? scheme)
    Parameters
    Type Name Description
    string uri

    The URI string.

    string scheme

    The scheme to use, or null to use HTTP.

    Returns
    Type Description
    string

    The URI string with a scheme prefix.

    View Source

    TrimPathEndSlash(string)

    Removes the trailing slash from the path portion of the URI.

    Declaration
    public static string TrimPathEndSlash(string uri)
    Parameters
    Type Name Description
    string uri

    The URI string.

    Returns
    Type Description
    string

    The URI string with the trailing slash removed from the path.

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX