---
title: "init(options:locale:order:)"
framework: swift
role: symbol
role_heading: Initializer
path: "swift/string/comparator/init(options:locale:order:)"
---

# init(options:locale:order:)

Creates a String.Comparator with the given CompareOptions and Locale.

## Declaration

```swift
init(options: String.CompareOptions, locale: Locale? = Locale.current, order: SortOrder = .forward)
```

## Parameters

- `options`: The options to use for comparison.
- `locale`: The locale to use for comparison. If nil, the comparison is unlocalized.
- `order`: The initial order to use for ordered comparison.
