PathString.StartsWithSegments Method

Definition

Overloads

StartsWithSegments(PathString)

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

StartsWithSegments(PathString, PathString)

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

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)

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

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)

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.

StartsWithSegments(PathString)

Source:
PathString.cs
Source:
PathString.cs
Source:
PathString.cs

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

C#
public bool StartsWithSegments (Microsoft.AspNetCore.Http.PathString other);

Parameters

other
PathString

The PathString to compare.

Returns

true if value matches the beginning of this string; otherwise, false.

Remarks

When the other parameter contains a trailing slash, the PathString being checked must either exactly match or include a trailing slash. For instance, for a PathString of "/a/b", this method will return true for "/a", but will return false for "/a/". Whereas, a PathString of "/a//b/" will return true when compared with "/a/".

Applies to

ASP.NET Core 9.0 ja muut versiot
Tuote Versiot
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

StartsWithSegments(PathString, PathString)

Source:
PathString.cs
Source:
PathString.cs
Source:
PathString.cs

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

C#
public bool StartsWithSegments (Microsoft.AspNetCore.Http.PathString other, out Microsoft.AspNetCore.Http.PathString remaining);

Parameters

other
PathString

The PathString to compare.

remaining
PathString

The remaining segments after the match.

Returns

true if value matches the beginning of this string; otherwise, false.

Remarks

When the other parameter contains a trailing slash, the PathString being checked must either exactly match or include a trailing slash. For instance, for a PathString of "/a/b", this method will return true for "/a", but will return false for "/a/". Whereas, a PathString of "/a//b/" will return true when compared with "/a/".

Applies to

ASP.NET Core 9.0 ja muut versiot
Tuote Versiot
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

StartsWithSegments(PathString, StringComparison)

Source:
PathString.cs
Source:
PathString.cs
Source:
PathString.cs

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

C#
public bool StartsWithSegments (Microsoft.AspNetCore.Http.PathString other, StringComparison comparisonType);

Parameters

other
PathString

The PathString to compare.

comparisonType
StringComparison

One of the enumeration values that determines how this PathString and value are compared.

Returns

true if value matches the beginning of this string; otherwise, false.

Remarks

When the other parameter contains a trailing slash, the PathString being checked must either exactly match or include a trailing slash. For instance, for a PathString of "/a/b", this method will return true for "/a", but will return false for "/a/". Whereas, a PathString of "/a//b/" will return true when compared with "/a/".

Applies to

ASP.NET Core 9.0 ja muut versiot
Tuote Versiot
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

StartsWithSegments(PathString, PathString, PathString)

Source:
PathString.cs
Source:
PathString.cs
Source:
PathString.cs

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

C#
public bool StartsWithSegments (Microsoft.AspNetCore.Http.PathString other, out Microsoft.AspNetCore.Http.PathString matched, out Microsoft.AspNetCore.Http.PathString remaining);

Parameters

other
PathString

The PathString to compare.

matched
PathString

The matched segments with the original casing in the source value.

remaining
PathString

The remaining segments after the match.

Returns

true if value matches the beginning of this string; otherwise, false.

Remarks

When the other parameter contains a trailing slash, the PathString being checked must either exactly match or include a trailing slash. For instance, for a PathString of "/a/b", this method will return true for "/a", but will return false for "/a/". Whereas, a PathString of "/a//b/" will return true when compared with "/a/".

Applies to

ASP.NET Core 9.0 ja muut versiot
Tuote Versiot
ASP.NET Core 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

StartsWithSegments(PathString, StringComparison, PathString)

Source:
PathString.cs
Source:
PathString.cs
Source:
PathString.cs

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

C#
public bool StartsWithSegments (Microsoft.AspNetCore.Http.PathString other, StringComparison comparisonType, out Microsoft.AspNetCore.Http.PathString remaining);

Parameters

other
PathString

The PathString to compare.

comparisonType
StringComparison

One of the enumeration values that determines how this PathString and value are compared.

remaining
PathString

The remaining segments after the match.

Returns

true if value matches the beginning of this string; otherwise, false.

Remarks

When the other parameter contains a trailing slash, the PathString being checked must either exactly match or include a trailing slash. For instance, for a PathString of "/a/b", this method will return true for "/a", but will return false for "/a/". Whereas, a PathString of "/a//b/" will return true when compared with "/a/".

Applies to

ASP.NET Core 9.0 ja muut versiot
Tuote Versiot
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

StartsWithSegments(PathString, StringComparison, PathString, PathString)

Source:
PathString.cs
Source:
PathString.cs
Source:
PathString.cs

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.

C#
public bool StartsWithSegments (Microsoft.AspNetCore.Http.PathString other, StringComparison comparisonType, out Microsoft.AspNetCore.Http.PathString matched, out Microsoft.AspNetCore.Http.PathString remaining);

Parameters

other
PathString

The PathString to compare.

comparisonType
StringComparison

One of the enumeration values that determines how this PathString and value are compared.

matched
PathString

The matched segments with the original casing in the source value.

remaining
PathString

The remaining segments after the match.

Returns

true if value matches the beginning of this string; otherwise, false.

Remarks

When the other parameter contains a trailing slash, the PathString being checked must either exactly match or include a trailing slash. For instance, for a PathString of "/a/b", this method will return true for "/a", but will return false for "/a/". Whereas, a PathString of "/a//b/" will return true when compared with "/a/".

Applies to

ASP.NET Core 9.0 ja muut versiot
Tuote Versiot
ASP.NET Core 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0