判断字符串是否是空或空格

+ (BOOL)stringIsNullOrEmpty:(NSString *)inputStr {
    BOOL isEmpty=YES;
    if (inputStr.length && [[inputStr stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] length]!=0) {
        isEmpty=NO;
    }
    return isEmpty;
}

你可能感兴趣的:(判断字符串是否是空或空格)