Check if a string is contained in another string
NSRange range = [comName rangeOfString:@"sp."]; if (range.location != NSNotFound) { [indexesToDelete addIndex:currentIndex]; } ... [tempArr removeObjectsAtIndexes:indexesToDelete];