/// <summary> /// Compares the specified <paramref name="span"/> and <paramref name="other"/> using the specified <paramref name="comparisonType"/>, /// and returns an integer that indicates their relative position in the sort order. /// <param name="span">The source span.</param> /// <param name="other">The value to compare with the source span.</param> /// <param name="comparisonType">One of the enumeration values that determines how the <paramref name="span"/> and <paramref name="other"/> are compared.</param> /// </summary> public static int CompareTo(this ReadOnlySpan <char> span, ReadOnlySpan <char> other, StringComparison comparisonType) { if (comparisonType == StringComparison.Ordinal) { return(span.SequenceCompareTo(other)); } return(string.Compare(span.ToString(), other.ToString(), comparisonType)); }