I am looking for a way to search for an arbitrary long string (10,000 characters) and find the number of repetitions of a particular keyword in a string. How can I do that?
I have this method, which pretty much takes into account the number of fragments left after the string is split by keywords, but it is not case sensitive.
-(void)countKeywords
{
NSArray* components = [self.salesCopy componentsSeparatedByString:@"search term"];
NSLog(@"search term number found: %i",components.count);
}
What is the best way to count the number of keywords per line?
source
share