Platforms to show: All Mac Windows Linux Cross-Platform
NSStringCompareMBS(s as string, t as string, options as Integer) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
global method | Cocoa | MBS Main Plugin | 8.6 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Following constants can be used for the compare:
NSCaseInsensitiveSearch | 1 | Case Insensitive |
NSLiteralSearch | 2 | Exact character-by-character equivalence |
NSBackwardsSearch | 4 | Search from end of source string |
NSAnchoredSearch | 8 | Search is limited to start (or end, if NSBackwardsSearch) of source string |
NSNumericSearch | 64 | 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 |
NSDiacriticInsensitiveSearch | 128 | If specified, ignores diacritics (o-umlaut = o) |
NSWidthInsensitiveSearch | 256 | If specified, ignores width differences ('a' = UFF41) |
NSForcedOrderingSearch | 512 | 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) |
The constants NSDiacriticInsensitiveSearch, NSWidthInsensitiveSearch and NSForcedOrderingSearch are only for Mac OS X 10.5 and newer versions.
Returns value constants:
NSOrderedAscending | -1 |
NSOrderedSame | 0 |
NSOrderedDescending | 1 |
Some examples using this global method:
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV TableView
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Hierarchical & Flat/ListBoxTV OutlineView
Blog Entries
The items on this page are in the following plugins: MBS Main Plugin.