MemoryExtensions.SequenceEqual 方法

定义

重载

SequenceEqual<T>(ReadOnlySpan<T>, ReadOnlySpan<T>)

通过使用 IEquatable{T} 比较元素,确定两个只读序列是否相等。等于(T)。

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

通过使用 IEquatable{T} 比较元素,确定范围和只读跨度是否相等。等于(T)。

SequenceEqual<T>(ReadOnlySpan<T>, ReadOnlySpan<T>, IEqualityComparer<T>)

通过使用 IEqualityComparer<T>比较元素来确定两个序列是否相等。

SequenceEqual<T>(Span<T>, ReadOnlySpan<T>, IEqualityComparer<T>)

通过使用 IEqualityComparer<T>比较元素来确定两个序列是否相等。

SequenceEqual<T>(ReadOnlySpan<T>, ReadOnlySpan<T>)

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

通过使用 IEquatable{T} 比较元素,确定两个只读序列是否相等。等于(T)。

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

类型参数

T

序列中元素的类型。

参数

span
ReadOnlySpan<T>

要比较的第一个序列。

other
ReadOnlySpan<T>

要比较的第二个序列。

返回

如果两个序列相等,则 true;否则,false

适用于

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

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

通过使用 IEquatable{T} 比较元素,确定范围和只读跨度是否相等。等于(T)。

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

类型参数

T

序列中元素的类型。

参数

span
Span<T>

要比较的跨度。

other
ReadOnlySpan<T>

要比较的只读范围。

返回

如果两个序列相等,则 true;否则,false

适用于

SequenceEqual<T>(ReadOnlySpan<T>, ReadOnlySpan<T>, IEqualityComparer<T>)

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

通过使用 IEqualityComparer<T>比较元素来确定两个序列是否相等。

public static bool SequenceEqual<T> (this ReadOnlySpan<T> span, ReadOnlySpan<T> other, System.Collections.Generic.IEqualityComparer<T>? comparer = default);
static member SequenceEqual : ReadOnlySpan<'T> * ReadOnlySpan<'T> * System.Collections.Generic.IEqualityComparer<'T> -> bool
<Extension()>
Public Function SequenceEqual(Of T) (span As ReadOnlySpan(Of T), other As ReadOnlySpan(Of T), Optional comparer As IEqualityComparer(Of T) = Nothing) As Boolean

类型参数

T

序列中元素的类型。

参数

span
ReadOnlySpan<T>

要比较的第一个序列。

other
ReadOnlySpan<T>

要比较的第二个序列。

comparer
IEqualityComparer<T>

比较元素时要使用的 IEqualityComparer<T> 实现,或 null 将默认 IEqualityComparer<T> 用于元素的类型。

返回

如果两个序列相等,则 true;否则,false

适用于

SequenceEqual<T>(Span<T>, ReadOnlySpan<T>, IEqualityComparer<T>)

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

通过使用 IEqualityComparer<T>比较元素来确定两个序列是否相等。

public static bool SequenceEqual<T> (this Span<T> span, ReadOnlySpan<T> other, System.Collections.Generic.IEqualityComparer<T>? comparer = default);
static member SequenceEqual : Span<'T> * ReadOnlySpan<'T> * System.Collections.Generic.IEqualityComparer<'T> -> bool
<Extension()>
Public Function SequenceEqual(Of T) (span As Span(Of T), other As ReadOnlySpan(Of T), Optional comparer As IEqualityComparer(Of T) = Nothing) As Boolean

类型参数

T

序列中元素的类型。

参数

span
Span<T>

要比较的第一个序列。

other
ReadOnlySpan<T>

要比较的第二个序列。

comparer
IEqualityComparer<T>

比较元素时要使用的 IEqualityComparer<T> 实现,或 null 将默认 IEqualityComparer<T> 用于元素的类型。

返回

如果两个序列相等,则 true;否则,false

适用于