简体   繁体   中英

Remove \\U00a0 from string - iOS

I've a following string received from server.

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";

I want to remove "\\U00a0"from string. Here is code to remove that but its not working.

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

is there any other way to get this thing done.

For anyone else who got this issue. This was a simple change in this line. It solved my problem.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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