Compares one string with another string.
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
- Core Foundation
The first string to use in the comparison.
The second string to use in the comparison.
Flags that select different types of comparisons, such as localized comparison, case-insensitive comparison, and non-literal comparison. If you want the default comparison behavior, pass
0. See String Comparison Flags for the available flags.
CFComparison value that indicates whether
the is equal to, less than, or greater than
You can affect how the comparison proceeds by specifying one or more option flags in
compare. Not all comparison options are currently implemented.