判断字符串是否为空
多角度判断字符串是否为空,返回BOOL值
1 + (BOOL) isBlankString:(NSString *)string { 2 if (string == nil || string == NULL) { 3 return YES; 4 } 5 if ([string isKindOfClass:[NSNull class]]) { 6 return YES; 7 } 8 if ([[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] length]==0) { 9 return YES; 10 } 11 return NO; 12 }