NSString *myString = @\"A B C D E F G\";
I want to remove the spaces, so the new string would be \"ABCDEFG\".
You can try this
- (NSString *)stripRemoveSpaceFrom:(NSString *)str { while ([str rangeOfString:@" "].location != NSNotFound) { str = [str stringByReplacingOccurrencesOfString:@" " withString:@""]; } return str; }
Hope this will help you out.