MemoryExtensions.SequenceEqual MemoryExtensions.SequenceEqual MemoryExtensions.SequenceEqual MemoryExtensions.SequenceEqual Method

定义

重载

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

通过使用 IEquatable{T}.Equals(T) 比较元素,确定两个只读序列是否相等。Determines whether two read-only sequences are equal by comparing the elements using IEquatable{T}.Equals(T).

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

通过使用 IEquatable{T}.Equals(T) 比较元素,确定跨度和只读跨度是否相等。Determines whether a span and a read-only span are equal by comparing the elements using IEquatable{T}.Equals(T).

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

通过使用 IEquatable{T}.Equals(T) 比较元素,确定两个只读序列是否相等。Determines whether two read-only sequences are equal by comparing the elements using IEquatable{T}.Equals(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

序列中的元素的类型。The type of elements in the sequence.

参数

span
ReadOnlySpan<T> ReadOnlySpan<T> ReadOnlySpan<T> ReadOnlySpan<T>

要比较的第一个序列。The first sequence to compare.

other
ReadOnlySpan<T> ReadOnlySpan<T> ReadOnlySpan<T> ReadOnlySpan<T>

要比较的第二个序列。The second sequence to compare.

返回

如果两个序列相等,则为 true;否则为 falsetrue if the two sequences are equal; otherwise, false.

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

通过使用 IEquatable{T}.Equals(T) 比较元素,确定跨度和只读跨度是否相等。Determines whether a span and a read-only span are equal by comparing the elements using IEquatable{T}.Equals(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

序列中的元素的类型。The type of elements in the sequence.

参数

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

要比较的跨度。The span to compare.

other
ReadOnlySpan<T> ReadOnlySpan<T> ReadOnlySpan<T> ReadOnlySpan<T>

要比较的只读跨度。The read-only span to compare.

返回

如果两个序列相等,则为 true;否则为 falsetrue if the two sequences are equal; otherwise, false.

适用于