MemoryExtensions.SequenceCompareTo 方法

定义

重载

SequenceCompareTo<T>(ReadOnlySpan<T>, ReadOnlySpan<T>)

通过使用 IComparable{T} 比较两个只读序列的相对顺序。CompareTo(T)。

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

通过使用 IComparable{T} 比较元素来确定范围和只读范围的相对顺序。CompareTo(T)。

SequenceCompareTo<T>(ReadOnlySpan<T>, ReadOnlySpan<T>)

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

通过使用 IComparable{T} 比较两个只读序列的相对顺序。CompareTo(T)。

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

类型参数

T

序列中元素的类型。

参数

span
ReadOnlySpan<T>

要比较的第一个序列。

other
ReadOnlySpan<T>

要比较的第二个序列。

返回

一个有符号整数,指示 spanother的相对顺序:
- 如果小于 0,则 span 早于 other
- 如果为 0,则 span 等于 other
- 如果大于 0,则 span 遵循 other

适用于

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

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

通过使用 IComparable{T} 比较元素来确定范围和只读范围的相对顺序。CompareTo(T)。

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

类型参数

T

范围中的元素类型。

参数

span
Span<T>

要比较的跨度。

other
ReadOnlySpan<T>

要比较的只读范围。

返回

一个有符号整数,指示 spanother的相对顺序:
- 如果小于 0,则 span 早于 other
- 如果为 0,则 span 等于 other
- 如果大于 0,则 span 遵循 other

适用于