文章来源:http://www.devhome.cc/forum.php?mod=viewthread&tid=4&page=1#pid5
废话少说,直接上代码:
- (BOOL) isBlankString:( NSString *)string {if (string == nil || string == NULL) {
return YES;
}
if ([string isKindOfClass:[NSNull class]]) {
return YES;
}
if ([[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] length]==0) {
return YES;
}
return NO;
}