I have an NSString
and I want to check if it has a NULL
value. If it does, then the if
condition should execute. Else it should execut
+(BOOL)isEmpty:(NSString *)str{
if (str == nil || str == (id)[NSNull null] || [[NSString stringWithFormat:@"%@",str] length] == 0 || [[[NSString stringWithFormat:@"%@",str] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] length] == 0){
return YES;
}
return NO;
}
Just pass your string in Method :)