Add string extensions

This commit is contained in:
Christoph Hagen 2022-10-11 11:52:39 +02:00
parent 4eecc9af20
commit b7ce607c8b

View File

@ -0,0 +1,12 @@
import Foundation
extension String {
var trimmed: String {
trimmingCharacters(in: .whitespacesAndNewlines)
}
var nonEmpty: String? {
self == "" ? nil : self
}
}