NSString 去掉两边空格
NSString *utlStr = [urlString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
复制代码
去掉 NSString 中的空格
NSString *utlStr = [urlString stringByReplacingOccurrencesOfString:@" " withString:@""];
复制代码
NSString 去掉两边空格
NSString *utlStr = [urlString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
复制代码
去掉 NSString 中的空格
NSString *utlStr = [urlString stringByReplacingOccurrencesOfString:@" " withString:@""];
复制代码
转载于:https://juejin.im/post/5a93c950f265da4e8b30021d