src/packages/EmbedIO/Utilities/UrlPath.cs
/// <summary>
/// Splits the specified URL path into segments, assuming it is valid and normalized.
/// </summary>
/// <param name="path">The URL path.</param>
/// <returns>An enumeration of path segments.</returns>
/// <remarks>
/// <para>Unless <paramref name="path"/> is a valid, normalized URL path,
/// the behavior of this method is unspecified. You should call this method
/// only after calling either <see cref="Normalize"/> or <see cref="Validate.UrlPath"/>
/// to check and normalize both parameters.</para>
/// <para>If you are not sure about the validity and/or normalization of <paramref name="path"/>,
/// call <see cref="StripPrefix"/> instead of this method.</para>
/// <para>A root URL path (<c>/</c>) will result in an empty enumeration.</para>
/// <para>The returned enumeration will be the same whether <paramref name="path"/> is a base URL path or not.</para>
/// </remarks>
/// <seealso cref="Split"/>
/// <seealso cref="Normalize"/>
/// <seealso cref="Validate.UrlPath"/>
Splits the specified URL path into segments, assuming it is valid and normalized.
Splits the specified URL path into segments assuming it is valid and normalized .
public static IEnumerable<string> UnsafeSplit([ValidatedNotNull] string path)
        {
            var length = path.Length;
            var position = 1; 
            while (position < length)
            {
                var slashPosition = path.IndexOf('/', position);
                if (slashPosition < 0)
                {
                    yield return path.Substring(position);
                    break;
                }
                yield return path.Substring(position, slashPosition - position);
                position = slashPosition + 1;
            }
        }
public static IEnumerable < string > UnsafeSplit ( [ ValidatedNotNull ] string path ) { var length = path . Length ; var position = 1 ; while ( position < length ) { var slashPosition = path . IndexOf ( ' ' , position ) ; if ( slashPosition < 0 ) { yield return path . Substring ( position ) ; break ; } yield return path . Substring ( position , slashPosition - position ) ; position = slashPosition + 1 ; } }
Splits the specified URL path into segments, assuming it is valid and normalized.
Splits the specified URL path into segments assuming it is valid and normalized .
// Skip initial slash
An enumeration of path segments.
An enumeration of path segments .
string
[ValidatedNotNull]
path
The URL path.
The URL path .
remarks
Unless  is a valid, normalized URL path,
the behavior of this method is unspecified. You should call this method
only after calling either  or
to check and normalize both parameters.If you are not sure about the validity and/or normalization of ,
call  instead of this method.A root URL path (/The returned enumeration will be the same whether  is a base URL path or not.
Unless is a valid normalized URL path the behavior of this method is unspecified . You should call this method only after calling either or to check and normalize both parameters . If you are not sure about the validity and / or normalization of call instead of this method . A root URL path ( / The returned enumeration will be the same whether is a base URL path or not .
seealso
None
seealso
None
seealso
None