11 lines
244 B
Swift
11 lines
244 B
Swift
import Foundation
|
|
|
|
extension String {
|
|
|
|
var clean: String {
|
|
lowercased()
|
|
.replacingOccurrences(of: "[^a-z0-9 ]", with: "", options: .regularExpression)
|
|
.trimmingCharacters(in: .whitespacesAndNewlines)
|
|
}
|
|
}
|