Assume that I have a String like this:
hello world this may have lots of sp:ace or little space
I would like to seperate this
It's very easy to do this with blocks, try something like this :
NSString* s = @"hello world this may have lots of space or little space";
NSMutableArray* ar = [NSMutableArray array];
[s enumerateSubstringsInRange:NSMakeRange(0, [s length]) options:NSStringEnumerationByWords usingBlock:^(NSString* word, NSRange wordRange, NSRange enclosingRange, BOOL* stop){
[ar addObject:word];
}];