Skip to content

Instantly share code, notes, and snippets.

@RustyKnight
Created August 29, 2018 22:01
Show Gist options
  • Save RustyKnight/c1cc88805ce0315a2cda373f60ee1519 to your computer and use it in GitHub Desktop.
Save RustyKnight/c1cc88805ce0315a2cda373f60ee1519 to your computer and use it in GitHub Desktop.
Simple "trimming" support for String
import Foundation
extension String {
var trimmed: String {
return self.trimmingCharacters(in: .whitespacesAndNewlines)
}
var isEmptyWhenTrimmed: Bool {
return trimmed.isEmpty
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment