iOS小记 -- iOS之判断字符串是否为空字符的方法

- (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;

}

你可能感兴趣的:(iOS小记 -- iOS之判断字符串是否为空字符的方法)