Contents

caseInsensitiveCompare(_:)

Returns the result of invoking Compare(_:options:) with NSCaseInsensitiveSearch as the only option.

Declaration

func caseInsensitiveCompare(_ string: String) -> ComparisonResult

Parameters

  • string:

    The string with which to compare the receiver.

Return Value

Returns an ComparisonResult value that indicates the lexical ordering. ComparisonResult.orderedAscending the receiver precedes aString in lexical ordering, ComparisonResult.orderedSame the receiver and aString are equivalent in lexical value, and ComparisonResult.orderedDescending if the receiver follows aString.

Discussion

This method is the equivalent of invoking compare(_:options:) with caseInsensitive as the only option.

See Also

Identifying and Comparing Strings