写一个字符串的扩展,实现判断字符串是否为空


- (BOOL) isBlankString { if ([self isEqualToString:@"(null)"]) { return YES; } if ([self isEqualToString:@"<null>"]) { return YES; } if (self == nil || self == NULL){ return YES; } if ([self isKindOfClass:[NSNull class]]){ return YES; } if ([[self stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] length]==0){ return YES; } return NO; }