It sounds like you have single spaces between words that you want to keep, but you might want to get rid of a series of many spaces between paragraphs. There are multiple ways to do this, but here is one that's easy to code:
NSMutableString* newStr = [NSMutableString stringWithString:oldStr];
NSUInteger numReplacements;
do {
NSRange fullRange = NSMakeRange(0, [newStr length]);
numReplacements = [newStr replaceOccurrencesOfString:@" " withString:@" "
options:0 range:fullRange];
} while(numReplacements > 0);
Read about the replaceOccurrencesOfString:withString:options:range:
method (of NSMutableString
) to see some details.
This is not the most efficient, but it works, and if you're only working with a small number of not-huge strings, the speed of execution won't be significant.
By the way, you need to do the replacement multiple times because, for example, doing it just once could replace four consecutive spaces by two consecutive spaces, and you'd still be left with multiple spaces.