How to check a string contains a particular character or word. In my case I have a string "red manual". Here I have to check for "red ma" in my string. I tried it by using range of string methods but its not satisfying the condition.
Here is my code
NSString *string = @"red manual";
NSRange newlineRange = [string rangeOfString:@"red ma"];
if(newlineRange.location != NSNotFound)
{
NSLog(@"found");
}
else
{
NSLog(@"not found");
}