import FindFaster
let text = "Lorem ipsum dolor sit amet"
let search = "or"
for await index in text.fastSearch(for: search) {
print("Found match at: \(index)")
}
// Prints:
// Found match at: 1
// Found match at: 15
Fast asynchronous swift collection search using the Boyer–Moore string-search algorithm. fastSearch
can be used with any BidirectionalCollection
where Element
is Equatable
and Hashable
, and is especially useful for searching large amounts of data or long strings and displaying the results as they come in.
FindFaster is used for find and replace in HextEdit, a fast and native macOS hex editor.