Enumeration

NSStringCompareOptions

These values represent the options available to many of the string classes’ search and comparison methods.

Overview

See Searching, Comparing, and Sorting Strings for details on the effects of these options.

Topics

Constants

NSCaseInsensitiveSearch

A case-insensitive search.

NSLiteralSearch

Exact character-by-character equivalence.

NSBackwardsSearch

Search from end of source string.

NSAnchoredSearch

Search is limited to start (or end, if NSBackwardsSearch) of source string.

NSNumericSearch

Numbers within strings are compared using numeric value, that is, Name2.txt < Name7.txt < Name25.txt.

NSDiacriticInsensitiveSearch

Search ignores diacritic marks.

NSWidthInsensitiveSearch

Search ignores width differences in characters that have full-width and half-width forms, as occurs in East Asian character sets.

NSForcedOrderingSearch

Comparisons are forced to return either NSOrderedAscending or NSOrderedDescending if the strings are equivalent but not strictly equal.

NSRegularExpressionSearch

The search string is treated as an ICU-compatible regular expression. If set, no other options can apply except NSCaseInsensitiveSearch and NSAnchoredSearch. You can use this option only with the rangeOfString:... methods and stringByReplacingOccurrencesOfString:withString:options:range:.