MemoryExtensions.CompareTo Methode

Definition

Vergleicht eine Zeichenspanne mit einer anderen unter Verwendung eines angegebenen Zeichenfolgenvergleichs und gibt eine ganze Zahl zurück, die ihre relative Position in der Sortierreihenfolge angibt.

public:
[System::Runtime::CompilerServices::Extension]
 static int CompareTo(ReadOnlySpan<char> span, ReadOnlySpan<char> other, StringComparison comparisonType);
public static int CompareTo (this ReadOnlySpan<char> span, ReadOnlySpan<char> other, StringComparison comparisonType);
static member CompareTo : ReadOnlySpan<char> * ReadOnlySpan<char> * StringComparison -> int
<Extension()>
Public Function CompareTo (span As ReadOnlySpan(Of Char), other As ReadOnlySpan(Of Char), comparisonType As StringComparison) As Integer

Parameter

span
ReadOnlySpan<Char>

Die Quellspanne.

other
ReadOnlySpan<Char>

Der Wert, der mit der Quellspanne verglichen werden soll.

comparisonType
StringComparison

Ein Enumerationswert, der bestimmt, wie span und other verglichen werden.

Gibt zurück

Eine ganze Zahl mit Vorzeichen, die die relative Reihenfolge von span und other angibt:
– Wenn kleiner als 0, span vor other.
– Wenn diese 0 (null) sind, ist span gleich other.
– Wenn größer als 0, folgt span auf other.

Gilt für: