NSMutableCharacterSet *_mySet = [NSMutableCharacterSet characterSetWithCharactersInString:@"aAfF"];
[_mySet formUnionWithCharacterSet:[NSCharacterSet decimalDigitCharacterSet]];
NSCharacterSet *myStringSet = [NSCharacterSet characterSetWithCharactersInString:mystring];
if ([_mySet isSupersetOfSet: myStringSet])
{
//This is will be true if myString contains ONLY " decimal numbers(0-9) and characters a,A,f,F"
}
No comments:
Post a Comment