Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ross.32

macrumors 6502
Original poster
May 27, 2007
259
0
If given a large HTML file in the form of a NSString, I need to create an array of substrings from the main string. I know what the first 4 characters of the substring will be.

So basically what I have to do is seach the HTML file for those characters and return a string containing those first 4 characters and and X amount of characters after it.

I then need to take every one of those substrings and put them in an array.

What would be the easiest way of going about this? Thank you!
 

lucasgladding

macrumors 6502
Feb 16, 2007
319
1
Waterloo, Ontario
The easiest is probably with the NSString class.
componentsSeparatedByString:

This will strip the separating characters, but you could always step through the array and add them back afterward. Using an NSScanner could be used as well, but I believe that ignores the separating characters too.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.