This documentation is also published as Markdown for efficient machine reading: the whole site is indexed at /llms.txt, and every page has a clean Markdown copy under /_llms/. These are generated from the same source and cost far fewer tokens to read than this rendered HTML.

Skip to main content Skip to navigation

UrlPath Pennington.Routing

A URL path value supporting composition and normalization.

Properties

Value string
Underlying path string.

Constructors

UrlPath

#
public UrlPath(string Value)

A URL path value supporting composition and normalization.

Parameters

Value string
Underlying path string.

Methods

EnsureLeadingSlash

#
public UrlPath EnsureLeadingSlash()

Returns a path guaranteed to start with a slash.

Returns

UrlPath

EnsureTrailingSlash

#
public UrlPath EnsureTrailingSlash()

Returns a path guaranteed to end with a slash.

Returns

UrlPath

Matches

#
public bool Matches(UrlPath other)

Compares two URL paths ignoring trailing slashes, index.html suffixes, and case.

Parameters

other UrlPath

Returns

bool

RemoveLeadingSlash

#
public UrlPath RemoveLeadingSlash()

Removes a leading slash if present.

Returns

UrlPath

RemoveTrailingSlash

#
public UrlPath RemoveTrailingSlash()

Removes a trailing slash (except from the root path).

Returns

UrlPath

ToString

#
public string ToString()

Returns the underlying URL string.

Returns

string

Pennington.Routing.UrlPath

namespace Pennington.Routing;

/// A URL path value supporting composition and normalization.
public struct UrlPath
{
    /// Returns a path guaranteed to start with a slash.
    
public UrlPath EnsureLeadingSlash()
; /// Returns a path guaranteed to end with a slash.
public UrlPath EnsureTrailingSlash()
; /// Compares two URL paths ignoring trailing slashes, index.html suffixes, and case.
public bool Matches(UrlPath other)
; /// Removes a leading slash if present.
public UrlPath RemoveLeadingSlash()
; /// Removes a trailing slash (except from the root path).
public UrlPath RemoveTrailingSlash()
; /// Returns the underlying URL string.
public string ToString()
; /// A URL path value supporting composition and normalization.
public UrlPath(string Value)
; /// Underlying path string.
public string Value { get; set; }
}