小编Kev*_*nvs的帖子

在Swift中解码一个字符串

我怎么能在swift中解码一个字符串?该字符串现在为test%2Enl,但正确的格式为test.nl.

我现在有这个:

 let encodedData = encodedString.dataUsingEncoding(NSUTF16StringEncoding)!
 let attributedOptions = [NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType]
 let attributedString = NSAttributedString(data: encodedData, options: attributedOptions, documentAttributes: nil, error: nil)!

 return attributedString.string     
Run Code Online (Sandbox Code Playgroud)

ios swift

16
推荐指数
2
解决办法
2万
查看次数

标签 统计

ios ×1

swift ×1