Sdl.Web.Common/Extensions/StringExtensions.cs
/// <summary>
/// Normalizes a URL path for a Page.
/// </summary>
/// <remarks>
/// The following normalization actions are taken:
/// <list type="bullet">
///     <item>Ensure the URL path is extensionless.</item>
///     <item>Ensure the URL path for an index page ends with "/index".</item>
/// </list>
/// </remarks>
/// <param name="urlPath">The input URL path (the subject for this extension method).</param>
/// <returns>The normalized URL path.</returns>
Normalizes a URL path for a Page.
Normalizes a URL path for a Page .
public static string NormalizePageUrlPath(this string urlPath)
        {
            if (urlPath == null)
            {
                return null;
            }
            if (urlPath.EndsWith(Constants.DefaultExtension))
            {
                urlPath = urlPath.Substring(0, urlPath.Length - Constants.DefaultExtension.Length);
            }
            if (urlPath.EndsWith("/"))
            {
                urlPath += Constants.DefaultExtensionLessPageName;
            }
            return urlPath;
        }
public static string NormalizePageUrlPath ( this string urlPath ) { if ( urlPath == null ) { return null ; } if ( urlPath . EndsWith ( Constants . DefaultExtension ) ) { urlPath = urlPath . Substring ( 0 , urlPath . Length - Constants . DefaultExtension . Length ) ; } if ( urlPath . EndsWith ( " " ) ) { urlPath += Constants . DefaultExtensionLessPageName ; } return urlPath ; }
Normalizes a URL path for a Page.
Normalizes a URL path for a Page .
The normalized URL path.
The normalized URL path .
string
this
urlPath
The input URL path (the subject for this extension method).
The input URL path ( the subject for this extension method ) .
remarks
The following normalization actions are taken.

Ensure the URL path is extensionless.Ensure the URL path for an index page ends with "/index".
The following normalization actions are taken . Ensure the URL path is extensionless . Ensure the URL path for an index page ends with " / index " .