NSString

去掉空格

[String stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];

替换字符

原文地址:https://www.cnblogs.com/jingdizhiwa/p/5383639.html