Class NSStringCompareOptions


  • public final class NSStringCompareOptions
    extends java.lang.Object
    These options apply to the various search/find and comparison methods (except where noted).
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static long AnchoredSearch
      Search is limited to start (or end, if NSBackwardsSearch) of source string
      static long BackwardsSearch
      Search from end of source string
      static long CaseInsensitiveSearch  
      static long DiacriticInsensitiveSearch
      If specified, ignores diacritics (o-umlaut == o)
      static long ForcedOrderingSearch
      If specified, comparisons are forced to return either NSOrderedAscending or NSOrderedDescending if the strings are equivalent but not strictly equal, for stability when sorting (e.g.
      static long LiteralSearch
      Exact character-by-character equivalence
      static long NumericSearch
      Added in 10.2; Numbers within strings are compared using numeric value, that is, Foo2.txt < Foo7.txt < Foo25.txt; only applies to compare methods, not find
      static long RegularExpressionSearch
      Applies to rangeOfString:..., stringByReplacingOccurrencesOfString:..., and replaceOccurrencesOfString:... methods only; the search string is treated as an ICU-compatible regular expression; if set, no other options can apply except NSCaseInsensitiveSearch and NSAnchoredSearch
      static long WidthInsensitiveSearch
      If specified, ignores width differences ('a' == UFF41)
    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LiteralSearch

        public static final long LiteralSearch
        Exact character-by-character equivalence
        See Also:
        Constant Field Values
      • BackwardsSearch

        public static final long BackwardsSearch
        Search from end of source string
        See Also:
        Constant Field Values
      • AnchoredSearch

        public static final long AnchoredSearch
        Search is limited to start (or end, if NSBackwardsSearch) of source string
        See Also:
        Constant Field Values
      • NumericSearch

        public static final long NumericSearch
        Added in 10.2; Numbers within strings are compared using numeric value, that is, Foo2.txt < Foo7.txt < Foo25.txt; only applies to compare methods, not find
        See Also:
        Constant Field Values
      • DiacriticInsensitiveSearch

        public static final long DiacriticInsensitiveSearch
        If specified, ignores diacritics (o-umlaut == o)
        See Also:
        Constant Field Values
      • WidthInsensitiveSearch

        public static final long WidthInsensitiveSearch
        If specified, ignores width differences ('a' == UFF41)
        See Also:
        Constant Field Values
      • ForcedOrderingSearch

        public static final long ForcedOrderingSearch
        If specified, comparisons are forced to return either NSOrderedAscending or NSOrderedDescending if the strings are equivalent but not strictly equal, for stability when sorting (e.g. "aaa" > "AAA" with NSCaseInsensitiveSearch specified)
        See Also:
        Constant Field Values
      • RegularExpressionSearch

        public static final long RegularExpressionSearch
        Applies to rangeOfString:..., stringByReplacingOccurrencesOfString:..., and replaceOccurrencesOfString:... methods only; the search string is treated as an ICU-compatible regular expression; if set, no other options can apply except NSCaseInsensitiveSearch and NSAnchoredSearch
        See Also:
        Constant Field Values