Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cocoa 在Swift 4.2中解码百分比编码字符串?_Cocoa_Swift4.2 - Fatal编程技术网

Cocoa 在Swift 4.2中解码百分比编码字符串?

Cocoa 在Swift 4.2中解码百分比编码字符串?,cocoa,swift4.2,Cocoa,Swift4.2,我正在尝试解码百分比编码字符串,但不知道如何解码。例如: let str = "Hello%20World" // I want to decode 'str' to 'Hello World' 有人知道在Swift 4.2中实现这一点的最佳方法吗?谢谢。要删除百分比编码,我将调用removingPercentEncoding方法 它可以工作!非常感谢你!

我正在尝试解码百分比编码字符串,但不知道如何解码。例如:

let str = "Hello%20World"

// I want to decode 'str' to 'Hello World'

有人知道在Swift 4.2中实现这一点的最佳方法吗?谢谢。

要删除百分比编码,我将调用
removingPercentEncoding
方法


它可以工作!非常感谢你!