-(BOOL)isDigit{
NSString *regex = @"^[0-9]+$";
NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",regex];
BOOL isMatch = [pred evaluateWithObject:self];
return isMatch;
}
-(BOOL)isDigitAndCharacter{
NSString *regex = @"^[a-zA-Z0-9]+$";
NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",regex];
BOOL isMatch = [pred evaluateWithObject:self];
return isMatch;
}
NSString *regex = @"^[0-9]+$";
NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",regex];
BOOL isMatch = [pred evaluateWithObject:self];
return isMatch;
}
-(BOOL)isDigitAndCharacter{
NSString *regex = @"^[a-zA-Z0-9]+$";
NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",regex];
BOOL isMatch = [pred evaluateWithObject:self];
return isMatch;
}