共用方式為


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

來源:
MemoryExtensions.cs
來源:
MemoryExtensions.cs
來源:
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>)

來源:
MemoryExtensions.cs
來源:
MemoryExtensions.cs
來源:
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

適用於