Olvasás angol nyelven

Megosztás a következőn keresztül:


StringSegment.Compare(StringSegment, StringSegment, StringComparison) Method

Definition

Compares substrings of two specified StringSegment objects using the specified rules, and returns an integer that indicates their relative position in the sort order.

C#
public static int Compare(Microsoft.Extensions.Primitives.StringSegment a, Microsoft.Extensions.Primitives.StringSegment b, StringComparison comparisonType);

Parameters

a
StringSegment

The first StringSegment to compare.

b
StringSegment

The second StringSegment to compare.

comparisonType
StringComparison

One of the enumeration values that specifies the rules for the comparison.

Returns

A 32-bit signed integer indicating the lexical relationship between the two comparands. The value is negative if a is less than b, 0 if the two comparands are equal, and positive if a is greater than b.

Applies to

Termék Verziók
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)