Caps-iOS/Caps/Extensions/String+Extensions.swift

11 lines
244 B
Swift
Raw Permalink Normal View History

2023-07-28 13:20:33 +02:00
import Foundation
extension String {
var clean: String {
lowercased()
.replacingOccurrences(of: "[^a-z0-9 ]", with: "", options: .regularExpression)
.trimmingCharacters(in: .whitespacesAndNewlines)
}
}