#[repr(u64)]pub enum NSStringCompareOptions {
CaseInsensitive = 1,
Literal = 2,
Backwards = 4,
Anchored = 8,
Numeric = 64,
DiacriticInsensitive = 128,
WidthInsensitive = 256,
ForcedOrdering = 512,
RegularExpression = 1_024,
}Expand description
These values represent the options available to many of the string classes’ search and comparison methods.
Variants§
CaseInsensitive = 1
A case-insensitive search.
Literal = 2
Exact character-by-character equivalence.
Backwards = 4
Search from end of source string.
Anchored = 8
Search is limited to start (or end, if NSBackwardsSearch) of source string.
Numeric = 64
Numbers within strings are compared using numeric value, that is, Name2.txt < Name7.txt < Name25.txt.
DiacriticInsensitive = 128
Search ignores diacritic marks.
WidthInsensitive = 256
Search ignores width differences in characters that have full-width and half-width forms, as occurs in East Asian character sets.
ForcedOrdering = 512
Comparisons are forced to return either NSOrderedAscending or NSOrderedDescending if the strings are equivalent but not strictly equal.
RegularExpression = 1_024
The search string is treated as an ICU-compatible regular expression. If set, no other options can apply except caseInsensitive and anchored. You can use this option only with the rangeOfString:… methods and replacingOccurrences(of:with:options:range:).