-1

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.

aqsa arshad
  • 801
  • 8
  • 27

1 Answers1

0

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

testString=[testString stringByReplacingOccurrencesOfString:@"\u00a0" withString:@""];
aqsa arshad
  • 801
  • 8
  • 27
  • `u00a0` is a non-breaking space, so it's probably more desirable to replace it with " " instead of eliminate (replace with "") it. – daltonf Aug 12 '19 at 22:40