标签:
1.去掉两端空格:
[str stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] ;
2.去掉所有空格:
[str stringByReplacingOccurrencesOfString:@" " withString:@""]
3.去掉多余空格:
字符串去掉空格问题
原文地址:http://www.cnblogs.com/paideblogs/p/5150705.html