Rediger

Del via


MemoryExtensions.SequenceCompareTo Method

Definition

Overloads

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

Determines the relative order of two read-only sequences by comparing their elements using IComparable{T}.CompareTo(T).

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

Determines the relative order of a span and a read-only span by comparing the elements using IComparable{T}.CompareTo(T).

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

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

Determines the relative order of two read-only sequences by comparing their elements using 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

Type Parameters

T

The type of elements in the sequence.

Parameters

span
ReadOnlySpan<T>

The first sequence to compare.

other
ReadOnlySpan<T>

The second sequence to compare.

Returns

A signed integer that indicates the relative order of span and other:
- If less than 0, span precedes than other.
- If 0, span equals other.
- If greater than 0, span follows other.

Applies to

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

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

Determines the relative order of a span and a read-only span by comparing the elements using 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

Type Parameters

T

The type of elements in the span.

Parameters

span
Span<T>

The span to compare.

other
ReadOnlySpan<T>

The read-only span to compare.

Returns

A signed integer that indicates the relative order of span and other:
- If less than 0, span precedes than other.
- If 0, span equals other.
- If greater than 0, span follows other.

Applies to