-1

i am having the hexValue of $ like string and i have searched that is it equivalent of $ so how can i convert it to $ ?

i have searched this thing but it not what i want Converting Hex String to NSData in Swift

Community
  • 1
  • 1
Raj Oriya
  • 78
  • 4

1 Answers1

0

Solved this by doing this

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 ""
        }
Hardik Thakkar
  • 15,269
  • 2
  • 94
  • 81
Raj Oriya
  • 78
  • 4