# Comparison and Equality

> StringZilla for Swift

Comparisons are SIMD-accelerated and return a `StringZillaOrdering` of `.ascending`, `.equal`, or `.descending`, or a `Bool`.

```swift
assert("apple".compare("banana") == .ascending)  // byte-order lexicographic
assert("abc".equals("abc"))                       // byte-level equality
```

`utf8UncasedOrder(_:)` performs the same ordering but with full Unicode case folding, so `"STRASSE"` and `"straße"` compare as equal.

```swift
assert("STRASSE".utf8UncasedOrder("straße") == .equal)
```

`import StringZilla`

## StringZillaOrdering

Result of a three-way string comparison.

```swift
enum StringZillaOrdering
```

Mirrors `Foundation.ComparisonResult` but is defined here so the package stays
Foundation-free and usable on Linux and embedded targets. The cases match the verdicts of the
exact and case-insensitive orderings.

- `ascending`
- `equal`
- `descending`

Conforms to: `Equatable`, `Hashable`, `Sendable`

