Search Results for

    Show / Hide Table of Contents

    Class UrlUtility

    Static methods to modify URL paths.

    Inheritance
    System.Object
    UrlUtility
    Namespace: PnP.Framework.Utilities
    Assembly: PnP.Framework.dll
    Syntax
    public static class UrlUtility : object

    Methods

    AppendQueryString(String, String)

    Adds query string parameters to the end of a querystring and guarantees the proper concatenation with ? and &.

    Declaration
    public static string AppendQueryString(string path, string queryString)
    Parameters
    System.String path

    A SharePoint URL

    System.String queryString

    Query string value that need to append to the URL

    Returns
    System.String

    Returns URL along with appended query string

    Combine(String, String)

    Combines a path and a relative path.

    Declaration
    public static string Combine(string path, string relative)
    Parameters
    System.String path

    A SharePoint URL

    System.String relative

    SharePoint relative URL

    Returns
    System.String

    Returns comibed path with a relative path

    Combine(String, String[])

    Combines a path and a relative path.

    Declaration
    public static string Combine(string path, params string[] relativePaths)
    Parameters
    System.String path

    A SharePoint URL

    System.String[] relativePaths

    SharePoint relative URLs

    Returns
    System.String

    Returns comibed path with a relative paths

    ContainsInvalidFileFolderChars(String)

    Checks if file or folder contains invalid characters or not

    Declaration
    public static bool ContainsInvalidFileFolderChars(this string content)
    Parameters
    System.String content

    File or folder name to check

    Returns
    System.Boolean

    True if contains invalid chars, false otherwise

    ContainsInvalidUrlChars(String)

    Checks if URL contains invalid characters or not

    Declaration
    public static bool ContainsInvalidUrlChars(this string content)
    Parameters
    System.String content

    Url value

    Returns
    System.Boolean

    Returns true if URL contains invalid characters. Otherwise returns false.

    EnsureTrailingSlash(String)

    Ensures that there is a trailing slash at the end of the URL

    Declaration
    public static string EnsureTrailingSlash(string urlToProcess)
    Parameters
    System.String urlToProcess

    Returns
    System.String

    IsIisVirtualDirectory(String)

    Tells URL is virtual directory or not

    Declaration
    public static bool IsIisVirtualDirectory(string url)
    Parameters
    System.String url

    SharePoint URL

    Returns
    System.Boolean

    Returns true if URL is virtual directory. Otherwise returns false.

    MakeRelativeUrl(String)

    Returns realtive URL of given URL

    Declaration
    public static string MakeRelativeUrl(string urlToProcess)
    Parameters
    System.String urlToProcess

    SharePoint URL to process

    Returns
    System.String

    Returns realtive URL of given URL

    RemoveUnallowedCharacters(String)

    Declaration
    public static string RemoveUnallowedCharacters(string str)
    Parameters
    System.String str

    Returns
    System.String

    ReplaceAccentedCharactersWithLatin(String)

    Declaration
    public static string ReplaceAccentedCharactersWithLatin(string str)
    Parameters
    System.String str

    Returns
    System.String

    ReplaceInvalidUrlChars(String, String)

    Replaces invalid characters with other characters

    Declaration
    public static string ReplaceInvalidUrlChars(this string content, string replacer)
    Parameters
    System.String content

    Url value

    System.String replacer

    string need to replace with invalid characters

    Returns
    System.String

    Returns replaced invalid characters from URL

    StripInvalidUrlChars(String)

    Removes invalid characters

    Declaration
    public static string StripInvalidUrlChars(this string content)
    Parameters
    System.String content

    Url value

    Returns
    System.String

    Returns URL without invalid characters

    UrlPathEncode(String)

    Encodes URL encoded in a way that SharePoint expected URLs to be encoded in client_LocationBasedDefaults.html

    Declaration
    public static string UrlPathEncode(this string content)
    Parameters
    System.String content

    Url value

    Returns
    System.String

    Returns URL encoded in a way that SharePoint expected URLs to be encoded in client_LocationBasedDefaults.html

    Back to top PnP Framework
    Generated by DocFX with Material UI
    spacer