Find a char or string in a NSString is very simple,
we have for example a NSString called thestring that contains “auto and bike”.
To find the word and, the code is here:
1 2 3 4 5 6 |
NSString *thestring = @"auto and bike"; if ([thestring rangeOfString:@"and"].location == NSNotFound) { //not found } else { //found } |