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>)

使用 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>

要比較的第二個序列。

傳回

Int32

帶正負號的整數,表示 spanother 的相對順序:
- 如果小於 0,則 spanother 之前。
- 如果為 0,span 等於 other
- 如果大於 0,則 spanother 之後。

適用於

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

使用 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>

要比較的唯讀範圍。

傳回

Int32

帶正負號的整數,表示 spanother 的相對順序:
- 如果小於 0,則 spanother 之前。
- 如果為 0,span 等於 other
- 如果大於 0,則 spanother 之後。

適用於