PathString PathString PathString Struct

Definition

Provides correct escaping for Path and PathBase values when needed to reconstruct a request or redirect URI string

[System.ComponentModel.TypeConverter(typeof(Microsoft.AspNetCore.Http.PathStringConverter))]
public struct PathString : IEquatable<Microsoft.AspNetCore.Http.PathString>
type PathString = struct
Public Structure PathString
Implements IEquatable(Of PathString)
Inheritance
PathStringPathStringPathString
Attributes
Implements

Constructors

PathString(String) PathString(String) PathString(String)

Initialize the path string with a given value. This value must be in unescaped format. Use PathString.FromUriComponent(value) if you have a path value which is in an escaped format.

Fields

Empty Empty Empty

Represents the empty path. This field is read-only.

Properties

HasValue HasValue HasValue

True if the path is not empty

Value Value Value

The unescaped path value

Methods

Add(PathString) Add(PathString) Add(PathString)

Adds two PathString instances into a combined PathString value.

Add(QueryString) Add(QueryString) Add(QueryString)

Combines a PathString and QueryString into the joined URI formatted string value.

Equals(PathString) Equals(PathString) Equals(PathString)

Compares this PathString value to another value. The default comparison is StringComparison.OrdinalIgnoreCase.

Equals(Object) Equals(Object) Equals(Object)

Compares this PathString value to another value. The default comparison is StringComparison.OrdinalIgnoreCase.

Equals(PathString, StringComparison) Equals(PathString, StringComparison) Equals(PathString, StringComparison)

Compares this PathString value to another value using a specific StringComparison type

FromUriComponent(String) FromUriComponent(String) FromUriComponent(String)

Returns an PathString given the path as it is escaped in the URI format. The string MUST NOT contain any value that is not a path.

FromUriComponent(Uri) FromUriComponent(Uri) FromUriComponent(Uri)

Returns an PathString given the path as from a Uri object. Relative Uri objects are not supported.

GetHashCode() GetHashCode() GetHashCode()

Returns the hash code for the PathString value. The hash code is provided by the OrdinalIgnoreCase implementation.

StartsWithSegments(PathString) StartsWithSegments(PathString) StartsWithSegments(PathString)

Determines whether the beginning of this PathString instance matches the specified PathString.

StartsWithSegments(PathString, PathString) StartsWithSegments(PathString, PathString) StartsWithSegments(PathString, PathString)

Determines whether the beginning of this PathString instance matches the specified PathString and returns the remaining segments.

StartsWithSegments(PathString, StringComparison) StartsWithSegments(PathString, StringComparison) StartsWithSegments(PathString, StringComparison)

Determines whether the beginning of this PathString instance matches the specified PathString when compared using the specified comparison option.

StartsWithSegments(PathString, PathString, PathString) StartsWithSegments(PathString, PathString, PathString) StartsWithSegments(PathString, PathString, PathString)

Determines whether the beginning of this PathString instance matches the specified PathString and returns the matched and remaining segments.

StartsWithSegments(PathString, StringComparison, PathString) StartsWithSegments(PathString, StringComparison, PathString) StartsWithSegments(PathString, StringComparison, PathString)

Determines whether the beginning of this PathString instance matches the specified PathString when compared using the specified comparison option and returns the remaining segments.

StartsWithSegments(PathString, StringComparison, PathString, PathString) StartsWithSegments(PathString, StringComparison, PathString, PathString) StartsWithSegments(PathString, StringComparison, PathString, PathString)

Determines whether the beginning of this PathString instance matches the specified PathString when compared using the specified comparison option and returns the matched and remaining segments.

ToString() ToString() ToString()

Provides the path string escaped in a way which is correct for combining into the URI representation.

ToUriComponent() ToUriComponent() ToUriComponent()

Provides the path string escaped in a way which is correct for combining into the URI representation.

Operators

Addition(String, PathString) Addition(String, PathString) Addition(String, PathString)
Addition(PathString, String) Addition(PathString, String) Addition(PathString, String)
Addition(PathString, PathString) Addition(PathString, PathString) Addition(PathString, PathString)

Operator call through to Add

Addition(PathString, QueryString) Addition(PathString, QueryString) Addition(PathString, QueryString)

Operator call through to Add

Equality(PathString, PathString) Equality(PathString, PathString) Equality(PathString, PathString)

Operator call through to Equals

Implicit(PathString to String) Implicit(PathString to String) Implicit(PathString to String)

Implicitly calls ToString().

Implicit(String to PathString) Implicit(String to PathString) Implicit(String to PathString)

Implicitly creates a new PathString from the given string.

Inequality(PathString, PathString) Inequality(PathString, PathString) Inequality(PathString, PathString)

Operator call through to Equals

Applies to