Add string extensions
This commit is contained in:
parent
4eecc9af20
commit
b7ce607c8b
12
Sources/App/Extensions/String+Extensions.swift
Normal file
12
Sources/App/Extensions/String+Extensions.swift
Normal file
@ -0,0 +1,12 @@
|
||||
import Foundation
|
||||
|
||||
extension String {
|
||||
|
||||
var trimmed: String {
|
||||
trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
}
|
||||
|
||||
var nonEmpty: String? {
|
||||
self == "" ? nil : self
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user