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");
   }

Comments

Popular posts from this blog

UITableView - Add or Remove Rows Dynamically (Objective C & Swift Source codes)

payUmoney Payment Gateway Integration in iOS App (Objective C)

Check Internet Connectivity Using AFNetworking 2.0