On Mac OS X, in Ojective-C, I wanted to know if anyone could give me some pointers as to how I could parse strings contained between “x” and “y”.
My current code only enables me to separate the strings separated by one componennt :
NSArray * allLines = [theDataObject componentsSeparatedByString:@"word-1"];
Ideally, I would like to isolate the strings contained between @”word-1″ and @”word-2″.
Could anyone help please? Thanks in advance!
Check the documentation for
NSScanner. The methods you want are-scanUpToString:intoString:and-scanString:intoString: