gpt4 book ai didi

objective-c - 如何用 Objective-C 替换 &ndash

转载 作者:太空狗 更新时间:2023-10-30 03:54:03 24 4
gpt4 key购买 nike

我正在从 API 返回 JSON,当文章文本返回时,很多时候会有破折号。但是破折号是 &ndash 而不是实际的 -...

如何将 &ndash 转换为实际的 -

感谢您的帮助!

最佳答案

 NSString *myString = @"Here is &ndash some text";
myString = [myString stringByReplacingOccurrencesOfString:@"&ndash" withString:@"-"];

关于objective-c - 如何用 Objective-C 替换 &ndash,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19611509/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com