StructureSwift
String.CompareOptions
iOS 8.0+
iPadOS 8.0+
Mac Catalyst 8.0+
macOS 10.10+
tvOS 9.0+
watchOS 2.0+
These options apply to the various search/find and comparison methods (except where noted).
struct CompareOptions
Topics
Initializers
Instance Properties
Type Properties
static let anchored: String.CompareOptionsSearch is limited to start (or end, if.backwards) of source stringstatic let backwards: String.CompareOptionsSearch from end of source stringstatic let caseInsensitive: String.CompareOptionsstatic let diacriticInsensitive: String.CompareOptionsIf specified, ignores diacritics (o-umlaut == o)static let forcedOrdering: String.CompareOptionsIf specified, comparisons are forced to return either.orderedAscendingor.orderedDescendingif the strings are equivalent but not strictly equal, for stability when sorting (e.g. “aaa” > “AAA” with.caseInsensitivespecified)static let literal: String.CompareOptionsExact character-by-character equivalencestatic let numeric: String.CompareOptionsNumbers within strings are compared using numeric value, that is, Foo2.txt < Foo7.txt < Foo25.txt; only applies to compare methods, not findstatic let regularExpression: String.CompareOptionsThe search string is treated as an ICU-compatible regular expression; if set, no other options can apply except.caseInsensitiveand.anchoredstatic let widthInsensitive: String.CompareOptionsIf specified, ignores width differences (‘a’ == UFF41)
Relationships
Conforms To
Swift.EquatableSwift.ExpressibleByArrayLiteralSwift.OptionSetSwift.RawRepresentableSwift.SendableSwift.SendableMetatypeSwift.SetAlgebra