2017-02-25 39 views

回答

0

做這個

let str = symbol 
     if let htmldata = str.data(using: String.Encoding.utf8), let attributedString = try? NSAttributedString(data: htmldata, options: [NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType], documentAttributes: nil) 
     { 
      let finalString = String(format: "%@",attributedString.string) 
      return finalString 
     } 
     else 
     { 
      return "" 
     } 
相關問題