Method SequenceEqual
SequenceEqual<T>(ExSpan<T>, ReadOnlyExSpan<T>)
Determines whether a span and a read-only span are equal by comparing the elements using Equals(T) (通过使用 Equals(T) 比较元素, 确定跨度和只读跨度是否相等).
public static bool SequenceEqual<T>(this ExSpan<T> span, ReadOnlyExSpan<T> other) where T : IEquatable<T>?
Parameters
span
ExSpan<T>The first sequence to compare (要比较的第一个序列).
other
ReadOnlyExSpan<T>The second sequence to compare (要比较的第二个序列).
Returns
- bool
true if the two sequences are equal; otherwise, false (如果两个序列相等, 则 true; 否则 false).
Type Parameters
T
The element type (元素的类型).
SequenceEqual<T>(ReadOnlyExSpan<T>, ReadOnlyExSpan<T>)
Determines whether two read-only sequences are equal by comparing the elements using Equals(T) (通过使用 Equals(T) 比较元素, 确定两个只读序列是否相等).
public static bool SequenceEqual<T>(this ReadOnlyExSpan<T> span, ReadOnlyExSpan<T> other) where T : IEquatable<T>?
Parameters
span
ReadOnlyExSpan<T>The first sequence to compare (要比较的第一个序列).
other
ReadOnlyExSpan<T>The second sequence to compare (要比较的第二个序列).
Returns
- bool
true if the two sequences are equal; otherwise, false (如果两个序列相等, 则 true; 否则 false).
Type Parameters
T
The element type (元素的类型).
SequenceEqual<T>(ExSpan<T>, ReadOnlyExSpan<T>, IEqualityComparer<T>?)
Determines whether a span and a read-only span are equal by comparing the elements using Equals(T) (通过使用 Equals(T) 比较元素, 确定跨度和只读跨度是否相等).
public static bool SequenceEqual<T>(this ExSpan<T> span, ReadOnlyExSpan<T> other, IEqualityComparer<T>? comparer = null)
Parameters
span
ExSpan<T>The first sequence to compare (要比较的第一个序列).
other
ReadOnlyExSpan<T>The second sequence to compare (要比较的第二个序列).
comparer
IEqualityComparer<T>The IEqualityComparer<T> implementation to use when comparing elements, or null to use the default IEqualityComparer<T> for the type of an element (比较元素时要使用的 IEqualityComparer<T> 实现. 或 null, 将使用元素的类型的默认 IEqualityComparer<T>).
Returns
- bool
true if the two sequences are equal; otherwise, false (如果两个序列相等, 则 true; 否则 false).
Type Parameters
T
SequenceEqual<T>(ReadOnlyExSpan<T>, ReadOnlyExSpan<T>, IEqualityComparer<T>?)
Determines whether two read-only sequences are equal by comparing the elements using Equals(T) (通过使用 Equals(T) 比较元素, 确定两个只读序列是否相等).
public static bool SequenceEqual<T>(this ReadOnlyExSpan<T> span, ReadOnlyExSpan<T> other, IEqualityComparer<T>? comparer = null)
Parameters
span
ReadOnlyExSpan<T>The first sequence to compare (要比较的第一个序列).
other
ReadOnlyExSpan<T>The second sequence to compare (要比较的第二个序列).
comparer
IEqualityComparer<T>The IEqualityComparer<T> implementation to use when comparing elements, or null to use the default IEqualityComparer<T> for the type of an element.
Returns
- bool
true if the two sequences are equal; otherwise, false (如果两个序列相等, 则 true; 否则 false).
Type Parameters
T