MemoryExtensions.EndsWith 方法

定义

重载

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

使用指定的 comparisonType 选项进行比较时,确定 span 末尾是否与指定的 value 匹配。

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

确定指定的序列是否出现在只读范围末尾。

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

确定指定的值是否出现在范围末尾。

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

确定指定的序列是否出现在范围末尾。

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

Source:
MemoryExtensions.Globalization.cs
Source:
MemoryExtensions.Globalization.cs
Source:
MemoryExtensions.Globalization.cs

使用指定的 comparisonType 选项进行比较时,确定 span 末尾是否与指定的 value 匹配。

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>

源范围。

value
ReadOnlySpan<Char>

要与源范围末尾进行比较的序列。

comparisonType
StringComparison

一个枚举值,该值确定如何比较 spanvalue

返回

true 如果 valuespan末尾匹配,则为 true;否则,false

适用于

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

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

确定指定的序列是否出现在只读范围末尾。

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

范围的类型。

参数

span
ReadOnlySpan<T>

源范围。

value
ReadOnlySpan<T>

要与源范围末尾进行比较的序列。

返回

true 如果 valuespan末尾匹配,则为 true;否则,false

适用于

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

确定指定的值是否出现在范围末尾。

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

类型参数

T

参数

span
ReadOnlySpan<T>

要搜索的跨度。

value
T

要比较的值。

返回

适用于

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

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

确定指定的序列是否出现在范围末尾。

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

范围的类型。

参数

span
Span<T>

源范围。

value
ReadOnlySpan<T>

要与源范围末尾进行比较的序列。

返回

true 如果 valuespan末尾匹配,则为 true;否则,false

适用于