System Library Common Framework
Search Results for

    *.Benchmark*,*.Tests*,*.ApiTests*,*.BaseTest*,DelegateJsonConverter,CalleeCancelledRequestException,ClientResponse,ContentType,OutputCachePolicy
    Show / Hide Table of Contents Show / Hide Table of Contents
    NamespaceSystemLibrary.Common.Framework.Extensions SystemLibrary.Common.Framework.Net.dll

    This class contains extension methods for Uri

    For instance: GetPrimaryDomain(), etc...

    UriExtensions

    public static class UriExtensions

    Inheritance
    object
    UriExtensions
    Examples
    Arguments
    X

    Methods

    Returns the domain part of the uri or blank, never null:

    https://www.sub1.sub2.domain.com => domain.com

    public static string GetPrimaryDomain(this Uri uri, string topLevelDomain = ".com")

    X
    var result = new Uri('https://systemlibrary.com/image?q=90&format=jpg').GetPrimaryDomain();
    // result is "systemlibrary.com"
    
    var result = new Uri('https://systemlibrary.github.io/systemlibrary-common-framework/image?q=90&format=jpg').GetPrimaryDomain();
    // result is "github.io"
    X
    Methods arguments
    Type Name Description
    Uri uri
    string topLevelDomain
    X
    Type Description
    string

    Primary domain name or "", never null

    }

    In This Article
    Package: nuget
    Source: github
    Website: System Library Common Framework