Instance Propertyswift 6.0.3FoundationInternationalization->Swift
locale
The locale to use for comparison if the comparator is localized, otherwise nil.
- iOS
- 15.0+
- macOS
- 12.0+
- tvOS
- 15.0+
- watchOS
- 8.0+
let locale: Locale?
The locale to use for comparison if the comparator is localized, otherwise nil.
let locale: Locale?
sSS30FoundationInternationalizationE10ComparatorV6locale0A10Essentials6LocaleVSgvp
What are these?7MBKJ
import Swift
import FoundationInternationalization
struct Comparator
A String
comparison performed using the given comparison options and locale.
@frozen struct String
A Unicode string value that is a collection of characters.
struct Locale
Locale
encapsulates information about linguistic, cultural, and technological conventions and standards. Examples of information encapsulated by a locale include the symbol used for the decimal separator in numbers and the way dates are formatted.
init(_ standardComparison: String.StandardComparator)
Creates a String.Comparator
that represents the same comparison as the given String.StandardComparator
.
init(from decoder: any Decoder) throws
init(options: String.CompareOptions, order: SortOrder = .forward)
let options: String.CompareOptions
The options to use for comparison.
var order: SortOrder
func compare(_ lhs: String, _ rhs: String) -> ComparisonResult
func encode(to encoder: any Encoder) throws
func hash(into hasher: inout Hasher)