1

Using Objective-C, how can I convert the NSString

@"Panda's Expenses"

into this string

@"Panda's Expenses"

?

2 Answers 2

2

Check these two posts. Should solve your issue.

HTML character decoding in Objective-C / Cocoa Touch

Converting & to & in Objective-C

0

Try this:

NSString *reformedPanda =
    [@"Panda's Expenses" stringByReplacingPercentEscapesUsingEncoding:NSASCIIStringEncoding];
2
  • 2
    That's for percent escapes such as %20 for a space. Nov 20, 2010 at 6:23
  • stringByReplacingOccurrencesOfString:withString: would be most helpful here
    – TPWang
    Jul 11, 2017 at 23:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.