I'm getting string like this from my api \\u{1F60A}
, But I'm not able to display emoji with this. I need this type format \u{1F60A}
to show emoji on the UILabel. So with 2 "\\"
I'm not able to show emoji in the screen and need to remove 1 "\"
from string.
I've tried below codes to remove "\" and have only 1 "\". But the result was either \\u{1F60A}
(with \ slashes) or u{1F60A}
(with no slashes).
let text = "\\u{1F60A}"
text = text.replacingOccurrences(of: "\\", with: "", options: .literal, range: nil) // producing the result "u{1F60A}"
text = text.replacingOccurrences(of: "\\\\", with: "\\", options: .literal, range: nil) // producing the result "\\u{1F60A}"
I'm not able to display the emoji in the text. I'm using xcode 10.2 and swift 4.2
Any help appreciated. TIA