語言

PathString.StartsWithSegments 方法

定義

多載

名稱 Description
StartsWithSegments(PathString)

判斷此 PathString 實例的開頭是否符合指定的 PathString。

StartsWithSegments(PathString, PathString)

判斷此 PathString 實例的起始是否符合指定 PathString 內容,並回傳剩餘的區段。

StartsWithSegments(PathString, StringComparison)

透過指定的比較選項比較,判斷該 PathString 實例的開頭是否符合指定的 PathString 結果。

StartsWithSegments(PathString, PathString, PathString)

判斷此 PathString 實例的開頭是否符合指定 PathString 內容,並回傳匹配後及剩餘的區段。

StartsWithSegments(PathString, StringComparison, PathString)

判斷此實例的開頭 PathString 是否符合指定的 PathString 比較選項,並回傳剩餘區段。

StartsWithSegments(PathString, StringComparison, PathString, PathString)

判斷此 PathString 實例的開頭是否符合指定的 PathString 比較選項,並回傳匹配及剩餘的區段。

StartsWithSegments(PathString)

來源:
PathString.cs
來源:
PathString.cs
來源:
PathString.cs

判斷此 PathString 實例的開頭是否符合指定的 PathString。

public:
 bool StartsWithSegments(Microsoft::AspNetCore::Http::PathString other);
public bool StartsWithSegments(Microsoft.AspNetCore.Http.PathString other);
member this.StartsWithSegments : Microsoft.AspNetCore.Http.PathString -> bool
Public Function StartsWithSegments (other As PathString) As Boolean

參數

other
PathString

要比較的 PathString。

傳回

如果值符合此字串的開頭,則為 true;否則為 false。

備註

當參數 other 包含尾部斜線時,被檢查的參數 PathString 必須完全匹配或包含尾部斜線。 例如,對於「/a/b」的 a PathString ,此方法會回傳 true 「/a」,但回傳 false 為「/a/」。 而 a PathString 的「/a//b/」則與「/a/」比較時會返回 true 。 其中 PathString 的反斜線('\')被視為等同於前斜線('/'),以便區段邊界偵測。 例如,當「/a\b」的 a PathString 與「/a」比較時會回傳 true 。

適用於

StartsWithSegments(PathString, PathString)

來源:
PathString.cs
來源:
PathString.cs
來源:
PathString.cs

判斷此 PathString 實例的起始是否符合指定 PathString 內容,並回傳剩餘的區段。

public:
 bool StartsWithSegments(Microsoft::AspNetCore::Http::PathString other, [Runtime::InteropServices::Out] Microsoft::AspNetCore::Http::PathString % remaining);
public bool StartsWithSegments(Microsoft.AspNetCore.Http.PathString other, out Microsoft.AspNetCore.Http.PathString remaining);
member this.StartsWithSegments : Microsoft.AspNetCore.Http.PathString * PathString -> bool
Public Function StartsWithSegments (other As PathString, ByRef remaining As PathString) As Boolean

參數

other
PathString

要比較的 PathString。

remaining
PathString

相符項目之後的其餘區段。

傳回

如果值符合此字串的開頭,則為 true;否則為 false。

備註

當參數 other 包含尾部斜線時,被檢查的參數 PathString 必須完全匹配或包含尾部斜線。 例如,對於「/a/b」的 a PathString ,此方法會回傳 true 「/a」,但回傳 false 為「/a/」。 而 a PathString 的「/a//b/」則與「/a/」比較時會返回 true 。 其中 PathString 的反斜線('\')被視為等同於前斜線('/'),以便區段邊界偵測。 例如,當「/a\b」的 a PathString 與「/a」比較時會回傳 true ,且 remaining 會變成「\b」(保留原始字元,而非正規化)。

適用於

StartsWithSegments(PathString, StringComparison)

來源:
PathString.cs
來源:
PathString.cs
來源:
PathString.cs

透過指定的比較選項比較,判斷該 PathString 實例的開頭是否符合指定的 PathString 結果。

public:
 bool StartsWithSegments(Microsoft::AspNetCore::Http::PathString other, StringComparison comparisonType);
public bool StartsWithSegments(Microsoft.AspNetCore.Http.PathString other, StringComparison comparisonType);
member this.StartsWithSegments : Microsoft.AspNetCore.Http.PathString * StringComparison -> bool
Public Function StartsWithSegments (other As PathString, comparisonType As StringComparison) As Boolean

參數

other
PathString

要比較的 PathString。

comparisonType
StringComparison

這是決定此數值與數值比較方式 PathString 的列舉數值之一。

傳回

如果值符合此字串的開頭,則為 true;否則為 false。

備註

當參數 other 包含尾部斜線時,被檢查的參數 PathString 必須完全匹配或包含尾部斜線。 例如,對於「/a/b」的 a PathString ,此方法會回傳 true 「/a」,但回傳 false 為「/a/」。 而 a PathString 的「/a//b/」則與「/a/」比較時會返回 true 。 其中 PathString 的反斜線('\')被視為等同於前斜線('/'),以便區段邊界偵測。 例如,當「/a\b」的 a PathString 與「/a」比較時會回傳 true 。

適用於

StartsWithSegments(PathString, PathString, PathString)

來源:
PathString.cs
來源:
PathString.cs
來源:
PathString.cs

判斷此 PathString 實例的開頭是否符合指定 PathString 內容,並回傳匹配後及剩餘的區段。

public:
 bool StartsWithSegments(Microsoft::AspNetCore::Http::PathString other, [Runtime::InteropServices::Out] Microsoft::AspNetCore::Http::PathString % matched, [Runtime::InteropServices::Out] Microsoft::AspNetCore::Http::PathString % remaining);
public bool StartsWithSegments(Microsoft.AspNetCore.Http.PathString other, out Microsoft.AspNetCore.Http.PathString matched, out Microsoft.AspNetCore.Http.PathString remaining);
member this.StartsWithSegments : Microsoft.AspNetCore.Http.PathString * PathString * PathString -> bool
Public Function StartsWithSegments (other As PathString, ByRef matched As PathString, ByRef remaining As PathString) As Boolean

參數

other
PathString

要比較的 PathString。

matched
PathString

來源值中具有原始大小寫的相符區段。

remaining
PathString

相符項目之後的其餘區段。

傳回

如果值符合此字串的開頭,則為 true;否則為 false。

備註

當參數 other 包含尾部斜線時,被檢查的參數 PathString 必須完全匹配或包含尾部斜線。 例如,對於「/a/b」的 a PathString ,此方法會回傳 true 「/a」,但回傳 false 為「/a/」。 而 a PathString 的「/a//b/」則與「/a/」比較時會返回 true 。 其中 PathString 的反斜線('\')被視為等同於前斜線('/'),以便區段邊界偵測。 例如,當「/a\b」的 a PathString 與「/a」比較時會回傳 true ,且 remaining 會變成「\b」(保留原始字元,而非正規化)。

適用於

StartsWithSegments(PathString, StringComparison, PathString)

來源:
PathString.cs
來源:
PathString.cs
來源:
PathString.cs

判斷此實例的開頭 PathString 是否符合指定的 PathString 比較選項,並回傳剩餘區段。

public:
 bool StartsWithSegments(Microsoft::AspNetCore::Http::PathString other, StringComparison comparisonType, [Runtime::InteropServices::Out] Microsoft::AspNetCore::Http::PathString % remaining);
public bool StartsWithSegments(Microsoft.AspNetCore.Http.PathString other, StringComparison comparisonType, out Microsoft.AspNetCore.Http.PathString remaining);
member this.StartsWithSegments : Microsoft.AspNetCore.Http.PathString * StringComparison * PathString -> bool
Public Function StartsWithSegments (other As PathString, comparisonType As StringComparison, ByRef remaining As PathString) As Boolean

參數

other
PathString

要比較的 PathString。

comparisonType
StringComparison

這是決定此數值與數值比較方式 PathString 的列舉數值之一。

remaining
PathString

相符項目之後的其餘區段。

傳回

如果值符合此字串的開頭,則為 true;否則為 false。

備註

當參數 other 包含尾部斜線時,被檢查的參數 PathString 必須完全匹配或包含尾部斜線。 例如,對於「/a/b」的 a PathString ,此方法會回傳 true 「/a」,但回傳 false 為「/a/」。 而 a PathString 的「/a//b/」則與「/a/」比較時會返回 true 。 其中 PathString 的反斜線('\')被視為等同於前斜線('/'),以便區段邊界偵測。 例如,當「/a\b」的 a PathString 與「/a」比較時會回傳 true ,且 remaining 會變成「\b」(保留原始字元,而非正規化)。

適用於

StartsWithSegments(PathString, StringComparison, PathString, PathString)

來源:
PathString.cs
來源:
PathString.cs
來源:
PathString.cs

判斷此 PathString 實例的開頭是否符合指定的 PathString 比較選項,並回傳匹配及剩餘的區段。

public:
 bool StartsWithSegments(Microsoft::AspNetCore::Http::PathString other, StringComparison comparisonType, [Runtime::InteropServices::Out] Microsoft::AspNetCore::Http::PathString % matched, [Runtime::InteropServices::Out] Microsoft::AspNetCore::Http::PathString % remaining);
public bool StartsWithSegments(Microsoft.AspNetCore.Http.PathString other, StringComparison comparisonType, out Microsoft.AspNetCore.Http.PathString matched, out Microsoft.AspNetCore.Http.PathString remaining);
member this.StartsWithSegments : Microsoft.AspNetCore.Http.PathString * StringComparison * PathString * PathString -> bool
Public Function StartsWithSegments (other As PathString, comparisonType As StringComparison, ByRef matched As PathString, ByRef remaining As PathString) As Boolean

參數

other
PathString

要比較的 PathString。

comparisonType
StringComparison

這是決定此數值與數值比較方式 PathString 的列舉數值之一。

matched
PathString

來源值中具有原始大小寫的相符區段。

remaining
PathString

相符項目之後的其餘區段。

傳回

如果值符合此字串的開頭,則為 true;否則為 false。

備註

當參數 other 包含尾部斜線時,被檢查的參數 PathString 必須完全匹配或包含尾部斜線。 例如,對於「/a/b」的 a PathString ,此方法會回傳 true 「/a」,但回傳 false 為「/a/」。 而 a PathString 的「/a//b/」則與「/a/」比較時會返回 true 。 其中 PathString 的反斜線('\')被視為等同於前斜線('/'),以便區段邊界偵測。 例如,當「/a\b」的 a PathString 與「/a」比較時會回傳 true ,且 remaining 會變成「\b」(保留原始字元,而非正規化)。

適用於