Its SIMD-accelerated string kernels are built directly on the C core, so the same search, comparison, hashing, and Unicode-aware methods work identically on Linux servers and embedded targets as they do on macOS, iOS, tvOS, watchOS, and visionOS.
There is no dependency on Foundation, Darwin, or any Apple-only runtime, which keeps binaries small and portable.
The package adds these methods directly to String, String.UTF8View, and Substring.UTF8View, all operating on the underlying UTF-8 bytes without intermediate copies.
The one exception is a lazily bridged NSString, whose UTF-8 bytes are not contiguous, so each call copies them first.
All operations are exposed through the StringZillaViewable protocol, which every supported string type conforms to.
Search methods return native Swift String.Index values or a Range<Index>, so results splice cleanly back into your strings.
Topics
| Installation | Add StringZilla as a Swift Package Manager dependency in your Package.swift. |
|---|---|
| Types35 | |
| Searching and Counting | Substring search returns the Index? |
| Comparison and Equality1 | Comparisons are SIMD-accelerated and return a StringZillaOrdering of .ascending, .equal, or .descending, or a Bool. |
| Unicode Segmentation | These methods return byte-accurate [Range<Index>] arrays you can subscript back into the source string. |
| Case Folding and Normalization7 | utf8UncasedFind(substring:) performs a case-insensitive search using full Unicode folding and returns a byte-accurate Range<Index>?. |
| Hashing and Checksums12 | hash(seed:) computes a fast 64-bit UInt64 hash of the content, with an optional seed. |
| Runtime Dispatch41 |