An easy way to replace NSMutableString / NSString parts

I am new to iPhone development (using iOS 5) and I am trying to replace with :spaces in NSMutableString. I am struggling with this for an hour, and it makes me use it replaceOccurrencesOfString:@":" withString:@" " options:nil range:;(I thought I could use it without options and ranges). I tried almost everything (especially for the parameter range), but it continues to complain about various things, such as bad receiver type.

Any suggestions on how to achieve this?

+5
source share
1 answer

So you call replaceOccurrencesOfString:to get the desired effect:

[myString replaceOccurrencesOfString:@":"
                          withString:@" "
                             options:NSLiteralSearch
                               range:NSMakeRange(0, myString.length)];
+11
source

All Articles