用另一个字符串替换 NSMutableString
我想用另一个字符串替换 NSMutableString (不是字符串的一部分,而是完整的字符串)
我尝试了不同的方法,但找不到更好的解决方案。
I want to replace NSMutableString with another String (Not a part of string but complete string)
I tried different approaches but couldnt find a better solution.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要使用名为
setString
的东西。这将用您想要的任何新字符串覆盖以前的字符串。尝试 -
检查 NSMutableString doc< /a>.还有其他方法,例如
appendString
等。You need to use something called
setString
. This will over-write the previous string with whatever new string you want.Try -
Check NSMutableString doc. There are other methods like
appendString
etc.[NSMutableString stringWithString:xxxx];是解决方案。很简单!
[NSMutableString stringWithString:xxxx]; is the solution. That was simple!