NSString *myString = @"A B C D E F G";
我想删除空格,所以新字符串是“ABCDEFG”。
最佳答案
你可以使用:
NSString *stringWithoutSpaces = [myString
stringByReplacingOccurrencesOfString:@" " withString:@""];
https://stackoverflow.com/questions/925780/
相关文章:
objective-c - 如何获取 Root View Controller ?
iphone - 是否有记录的方法来设置 iPhone 方向?
objective-c - NSAutoreleasePool 自动释放池是如何工作的?
objective-c - 容器 View Controller 示例
objective-c - 使用 NSPredicate 根据 NSDictionary 键过滤 N
iphone - iOS:在代码中访问 app-info.plist 变量