If you want to make sure that the text has a specific letter (instead of a simple letter), use the message rangeOfString:
For example, so that the text contains the letter "Q":
NSString *string = @"poQduu"; if ([string rangeOfString:@"Q"].location != NSNotFound) { DLog (@"Yes, we have a Q at location %i", [string rangeOfString:@"Q"].location ); }
Like others (Rob Napier), note that if you want to find ANY letter, use the message rangeOfCharacterFromSet:
if ([string rangeOfCharacterFromSet:[NSCharacterSet letterCharacterSet]].location != NSNotFound) ...
source share