Convert Unicode character to NSString

前端 未结 3 992
粉色の甜心
粉色の甜心 2020-12-06 22:02

I have received string from webservice which contains Unicode character. I want to convert that To plain NSString. so How can i do that?

ex: \"This isn\\u0092t your

3条回答
  •  一生所求
    2020-12-06 22:19

    There is a library which does conversion https://github.com/alexaubry/HTMLString. It will convert all kind of Unicode character.

    let escapedSnack = "Fish & Chips"
    let snack = escapedSnack.removingHTMLEntities // "Fish & Chips" 
    

提交回复
热议问题