To do it right, taking into account the problems mentioned in David Ronquist's comment, do something like this:
NSMutableString* result = [origString mutableCopy]; [result enumerateSubstringsInRange:NSMakeRange(0, [result length]) options:NSStringEnumerationByComposedCharacterSequences | NSStringEnumerationSubstringNotRequired usingBlock:^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop){ if (substringRange.location > 0) [result insertString:@" " atIndex:substringRange.location]; }];
source share