How can I search a string using rangeOfString for uppercase and lowercase occurrences?
This is what I have so far;
for (NSString* key in words) {
if ([searchfield.text rangeOfString:key].location != NSNotFound)
{
NSString *textresult = [words objectForKey:key];
NSLog(@"Answer: %@", textresult);
result.text = textresult;
result.tag = 1;
}
Thanks
Simply search for the appropriate
keyin upper or lower case:and
If you do not care if the user used upper or lower case, simply use the
NSCaseInsensitiveSearchoption: