Hi I have a News Reader and I keep getting a string like this -
two New York police officers shot dead in 'ambush'
I want the string two New York police officers shot dead in ambush
How can I scan from & to ; and then delete occurrences of the scan.
I created a scanner like so -
NSString *webString222222 = filteredTitle2;
NSScanner *stringScanner222222 = [NSScanner scannerWithString:webString222222];
NSString *content222222 = [[NSString alloc] init];
[stringScanner222222 scanUpToString:@"&" intoString:Nil];
[stringScanner222222 scanUpToString:@";" intoString:&content222222];
NSString *filteredTitle222 = [content222222 stringByReplacingOccurrencesOfString:content222222 withString:@""];
NSString *filteredTitle22 = [filteredTitle222 stringByReplacingOccurrencesOfString:@"&" withString:@""];
But when I do this code the whole text disappears! Every single word. When I check the title in my NSLog that is the only & sign in there and the only ; sign in there! Im not sure where I went wrong here.