Objective-C::
How do I trim " " and "\n" in NSMutableString.
Objective-C::
How do I trim " " and "\n" in NSMutableString.
How about calling replaceOccurrencesOfString:withString:options:range twice, replacing " " and then "\n" with nothing?
NSCharacterSet* charsToTrim = [NSCharacterSet characterSetWithCharactersInString:@" \n"];
NSString* trimmedStr = [aStr stringByTrimmingCharactersInSet:charsToTrim];