typedef NS_OPTIONS(NSUInteger, NSStringCompareOptions) {
NSCaseInsensitiveSearch = 1,
NSLiteralSearch = 2, /* 准确的通过字符串一个个进行比较 */
NSBackwardsSearch = 4, /* 从后往前进行查找 */
NSAnchoredSearch = 8, /* 搜索从开始的位置进行查找Search is limited to start (or end, if NSBackwardsSearch) of source string */
NSNumericSearch = 64, /* 数字字符串进行比较 */
NSDiacriticInsensitiveSearch NS_ENUM_AVAILABLE(10_5, 2_0) = 128, /* 忽略 "-"符号的比较*/
NSWidthInsensitiveSearch NS_ENUM_AVAILABLE(10_5, 2_0) = 256, /*忽略字符串的长度,比较出结果 */
NSForcedOrderingSearch NS_ENUM_AVAILABLE(10_5, 2_0) = 512, /* 忽略不区分大小写比较的选项,并强制返回 NSOrderedAscending 或者NSOrderedDescending */
NSRegularExpressionSearch NS_ENUM_AVAILABLE(10_7, 3_2) = 1024 /* 只能应用于rangeOfString:..., stringByReplacingOccurre
ncesOfString:...和 replaceOccurrencesOfStri
ng:... 方法。使用通用兼容的比较方法,如果设置此项,可以去掉NSCaseInsensitiveSearch 和 NSAnchoredSearch */
NSCaseInsensitiveSearch = 1,
NSLiteralSearch = 2, /* 准确的通过字符串一个个进行比较 */
NSBackwardsSearch = 4, /* 从后往前进行查找 */
NSAnchoredSearch = 8, /* 搜索从开始的位置进行查找Search is limited to start (or end, if NSBackwardsSearch) of source string */
NSNumericSearch = 64, /* 数字字符串进行比较 */
NSDiacriticInsensitiveSearch NS_ENUM_AVAILABLE(10_5, 2_0) = 128, /* 忽略 "-"符号的比较*/
NSWidthInsensitiveSearch NS_ENUM_AVAILABLE(10_5, 2_0) = 256, /*忽略字符串的长度,比较出结果 */
NSForcedOrderingSearch NS_ENUM_AVAILABLE(10_5, 2_0) = 512, /* 忽略不区分大小写比较的选项,并强制返回 NSOrderedAscending 或者NSOrderedDescending */
NSRegularExpressionSearch NS_ENUM_AVAILABLE(10_7, 3_2) = 1024 /* 只能应用于rangeOfString:..., stringByReplacingOccurre
};