我正在尝试从以下内容中删除引号:
“你好”
这样字符串就是:
你好
最佳答案
查看 Apple 的文档:
你可能想要:
stringByReplacingOccurrencesOfString:withString:
返回一个新字符串,其中接收方中所有出现的目标字符串都被另一个给定字符串替换。
- (NSString *)stringByReplacingOccurrencesOfString:(NSString *)target withString:(NSString *)replacement
所以,像这样的东西应该可以工作:
newString = [myString stringByReplacingOccurrencesOfString:@"\"" withString:@""];
关于iphone - 如何从 NSString 中删除引号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4121478/