繁体   English   中英

从字符串中删除\\\\ U00a0-iOS

[英]Remove \\U00a0 from string - iOS

我从服务器收到以下字符串。

body = "Subject: This is from webportal \nTo: My Account \n...\n\n\nLTD Emojis:100k:ltd:eyes:trophy    \nDefault Emoji \\ud83d\\ude1b\\ud83d\\ude31\\ud83d\\ude0d \\ud83d\\ude3b\U00a0\\ud83d\\ude48     \n-- \nStephen acc";

我想从字符串中删除“ \\ U00a0”。 这是删除它的代码,但是它不起作用。

testString=[testString stringByReplacingOccurrencesOfString:@"\\U00a0" withString:@""];

还有其他方法可以完成此任务。

对于其他遇到此问题的人。 这是此行中的一个简单更改。 它解决了我的问题。

testString=[testString stringByReplacingOccurrencesOfString:@"\u00a0" withString:@""];

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM