MemoryExtensions.EndsWith MemoryExtensions.EndsWith MemoryExtensions.EndsWith MemoryExtensions.EndsWith Method

定义

重载

EndsWith(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison) EndsWith(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison) EndsWith(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison) EndsWith(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison)

使用指定的 comparisonType 选项进行比较时,确定 span 的结尾是否与指定的 value 匹配。Determines whether the end of the span matches the specified value when compared using the specified comparisonType option.

EndsWith<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) EndsWith<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) EndsWith<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) EndsWith<T>(ReadOnlySpan<T>, ReadOnlySpan<T>)

确定指定的序列是否出现在只读跨度的结尾。Determines whether the specified sequence appears at the end of a read-only span.

EndsWith<T>(Span<T>, ReadOnlySpan<T>) EndsWith<T>(Span<T>, ReadOnlySpan<T>) EndsWith<T>(Span<T>, ReadOnlySpan<T>) EndsWith<T>(Span<T>, ReadOnlySpan<T>)

确定指定的序列是否出现在跨度的结尾。Determines whether the specified sequence appears at the end of a span.

EndsWith(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison) EndsWith(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison) EndsWith(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison) EndsWith(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison)

使用指定的 comparisonType 选项进行比较时,确定 span 的结尾是否与指定的 value 匹配。Determines whether the end of the span matches the specified value when compared using the specified comparisonType option.

public:
[System::Runtime::CompilerServices::Extension]
 static bool EndsWith(ReadOnlySpan<char> span, ReadOnlySpan<char> value, StringComparison comparisonType);
public static bool EndsWith (this ReadOnlySpan<char> span, ReadOnlySpan<char> value, StringComparison comparisonType);
static member EndsWith : ReadOnlySpan<char> * ReadOnlySpan<char> * StringComparison -> bool
<Extension()>
Public Function EndsWith (span As ReadOnlySpan(Of Char), value As ReadOnlySpan(Of Char), comparisonType As StringComparison) As Boolean

参数

span
ReadOnlySpan<Char>

源跨度。The source span.

value
ReadOnlySpan<Char>

要与源跨度的结尾进行比较的序列。The sequence to compare to the end of the source span.

comparisonType
StringComparison StringComparison StringComparison StringComparison

用于确定如何比较 spanvalue 的枚举值。An enumeration value that determines how span and value are compared.

返回

如果 valuespan 的结尾匹配,则为 true;否则为 falsetrue if value matches the end of span; otherwise, false.

EndsWith<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) EndsWith<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) EndsWith<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) EndsWith<T>(ReadOnlySpan<T>, ReadOnlySpan<T>)

确定指定的序列是否出现在只读跨度的结尾。Determines whether the specified sequence appears at the end of a read-only span.

public:
generic <typename T>
 where T : IEquatable<T>[System::Runtime::CompilerServices::Extension]
 static bool EndsWith(ReadOnlySpan<T> span, ReadOnlySpan<T> value);
public static bool EndsWith<T> (this ReadOnlySpan<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>;
static member EndsWith : ReadOnlySpan<'T (requires 'T :> IEquatable<'T>)> * ReadOnlySpan<'T (requires 'T :> IEquatable<'T>)> -> bool (requires 'T :> IEquatable<'T>)
<Extension()>
Public Function EndsWith(Of T As IEquatable(Of T)) (span As ReadOnlySpan(Of T), value As ReadOnlySpan(Of T)) As Boolean

类型参数

T

范围的类型。The type of the span.

参数

value
ReadOnlySpan<T> ReadOnlySpan<T> ReadOnlySpan<T> ReadOnlySpan<T>

要与源跨度的结尾进行比较的序列。The sequence to compare to the end of the source span.

返回

如果 valuespan 的结尾匹配,则为 true;否则为 falsetrue if value matches the end of span; otherwise, false.

EndsWith<T>(Span<T>, ReadOnlySpan<T>) EndsWith<T>(Span<T>, ReadOnlySpan<T>) EndsWith<T>(Span<T>, ReadOnlySpan<T>) EndsWith<T>(Span<T>, ReadOnlySpan<T>)

确定指定的序列是否出现在跨度的结尾。Determines whether the specified sequence appears at the end of a span.

public:
generic <typename T>
 where T : IEquatable<T>[System::Runtime::CompilerServices::Extension]
 static bool EndsWith(Span<T> span, ReadOnlySpan<T> value);
public static bool EndsWith<T> (this Span<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>;
static member EndsWith : Span<'T (requires 'T :> IEquatable<'T>)> * ReadOnlySpan<'T (requires 'T :> IEquatable<'T>)> -> bool (requires 'T :> IEquatable<'T>)
<Extension()>
Public Function EndsWith(Of T As IEquatable(Of T)) (span As Span(Of T), value As ReadOnlySpan(Of T)) As Boolean

类型参数

T

范围的类型。The type of the span.

参数

span
Span<T> Span<T> Span<T> Span<T>

源跨度。The source span.

value
ReadOnlySpan<T> ReadOnlySpan<T> ReadOnlySpan<T> ReadOnlySpan<T>

要与源跨度的结尾进行比较的序列。The sequence to compare to the end of the source span.

返回

如果 valuespan 的结尾匹配,则为 true;否则为 falsetrue if value matches the end of span; otherwise, false.

适用于