Fix searching with special characters

This commit is contained in:
Christoph Hagen
2023-07-28 13:20:33 +02:00
parent 5394c13218
commit 68ddbf1eb3
4 changed files with 15 additions and 12 deletions

View File

@@ -0,0 +1,10 @@
import Foundation
extension String {
var clean: String {
lowercased()
.replacingOccurrences(of: "[^a-z0-9 ]", with: "", options: .regularExpression)
.trimmingCharacters(in: .whitespacesAndNewlines)
}
}