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

subo

macrumors newbie
Original poster
Jan 11, 2010
5
0
I have an NSString*

NSString *str = @"the---quick-------brown--fox----jumps";

How can i create an NSArray from it like this, Thanks!

Array {

'the',
'---',
'quick',
'-------',
'brown',
'--',
'fox',
'----',
'jumps'

}
 
I tried this but dont know how to go futher:
NSString *str = @"the---quick-------brown--fox----jumps";
NSCharacterSet *lineSeparatingSet = [NSCharacterSet characterSetWithCharactersInString:mad:"-"];
NSArray *lines = [str componentsSeparatedByCharactersInSet:lineSeparatingSet];

NSLog(@"%@", lines);
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.