src/packages/EmbedIO/Utilities/UrlPath.cs
/// <summary>
/// Normalizes the specified URL path.
/// </summary>
/// <param name="path">The URL path.</param>
/// <param name="isBasePath">if set to <see langword="true"/>, treat the URL path
/// as a base path, i.e. ensure it ends with a slash (<c>/</c>) character;
/// otherwise, ensure that it does NOT end with a slash character.</param>
/// <returns>The normalized path.</returns>
/// <exception cref="ArgumentException">
/// <paramref name="path"/> is not a valid URL path.
/// </exception>
/// <remarks>
/// <para>A normalized URL path is one where each run of two or more slash
/// (<c>/</c>) characters has been replaced with a single slash character.</para>
/// <para>This method does NOT try to decode URL-encoded characters.</para>
/// <para>If you are sure that <paramref name="path"/> is a valid URL path,
/// for example because you have called <see cref="IsValid"/> and it returned
/// <see langword="true"/>, then you may call <see cref="UnsafeNormalize"/>
/// instead of this method. <see cref="UnsafeNormalize"/> is slightly faster because
/// it skips the initial validity check.</para>
/// <para>There is no need to call this method for a method parameter
/// for which you have already called <see cref="Validate.UrlPath"/>.</para>
/// </remarks>
/// <seealso cref="UnsafeNormalize"/>
/// <seealso cref="IsValid"/>
/// <seealso cref="Validate.UrlPath"/>
Normalizes the specified URL path.
Normalizes the specified URL path .
public static string Normalize(string path, bool isBasePath)
        {
            var exception = ValidateInternal(nameof(path), path);
            if (exception != null)
                throw exception;
            return UnsafeNormalize(path, isBasePath);
        }
public static string Normalize ( string path , bool isBasePath ) { var exception = ValidateInternal ( nameof ( path ) , path ) ; if ( exception != null ) throw exception ; return UnsafeNormalize ( path , isBasePath ) ; }
Normalizes the specified URL path.
Normalizes the specified URL path .
The normalized path.
The normalized path .
None
path
string
The URL path.
The URL path .
isBasePath
bool
if set to , treat the URL path
as a base path, i.e. ensure it ends with a slash (
if set to treat the URL path as a base path i . e . ensure it ends with a slash (
remarks
A normalized URL path is one where each run of two or more slash
(/This method does NOT try to decode URL-encoded characters.If you are sure that  is a valid URL path,
for example because you have called  and it returned
, then you may call
instead of this method.  is slightly faster because
it skips the initial validity check.There is no need to call this method for a method parameter
for which you have already called .
A normalized URL path is one where each run of two or more slash ( / This method does NOT try to decode URL - encoded characters . If you are sure that is a valid URL path for example because you have called and it returned then you may call instead of this method . is slightly faster because it skips the initial validity check . There is no need to call this method for a method parameter for which you have already called .
seealso
None
seealso
None
seealso
None