Saturday, 14 July 2012

Check part of String is present in NSString

Below is code snippet to check whether part of string is present in a provided NSString



 NSString *myString = @"This is an APPLE";
 if ([ myString  rangeOfString:@"APPLE"].location != NSNotFound)
   {
        NSLog(@"Found");
   }
   else
   {
        NSLog(@"Not Found");
   }

No comments:

Post a Comment