我有$ like字符串的hexValue,我搜索了它相当于$所以如何将其转换为$?
我搜索过这个东西但不是我想要的东西 Converting Hex String to NSData in Swift
答案 0 :(得分: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 ""
}