caipivara
3/26/2015 - 10:01 PM

Blank string in Swift

Blank string in Swift


extension String {
	
	var isBlank: Bool {
		get {
			let trimmed = stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceCharacterSet())
			return trimmed.isEmpty
		}
	}
	
}