Instance Method


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


func caseInsensitiveCompare(_ string: String) -> ComparisonResult



The string with which to compare the receiver.

Return Value

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


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

See Also

Related Symbols

func localizedCaseInsensitiveCompare(String)

Compares the string with a given string using a case-insensitive, localized, comparison.

func compare(String, options: NSString.CompareOptions = [])

Compares the string with the specified string using the given options.