0

I am getting I\\U00b4m in place of I'm. How to decode or replace this \\U00b4 from string ?

I\\U00b4m looking for the only one man in my life.

Jaap
  • 81,064
  • 34
  • 182
  • 193
  • Please [edit] your question and provide more context and relevant code. How and where do you get this string from? – rmaddy Feb 13 '17 at 17:43
  • 3
    Looks like a [golden oldie](http://stackoverflow.com/questions/24318171) – marabu Feb 13 '17 at 17:47
  • 1
    Possible duplicate of [Using Swift to unescape unicode characters, ie \u1234](http://stackoverflow.com/questions/24318171/using-swift-to-unescape-unicode-characters-ie-u1234) – JAL Feb 13 '17 at 18:00

1 Answers1

-3

Easy way:

let aString = "This is my string"
let newString = aString.replacingOccurrences(of: "\U00b4", with: "", options: .literal, range: nil)

More info in here: Any way to replace characters on Swift String?

Community
  • 1
  • 1
Ahmadreza
  • 6,950
  • 5
  • 50
  • 69