Decode file name from path (Swift 5)

BLC :
let FileName = ("\(urls[0])" as NSString).lastPathComponent

full file url: file:///private/var/mobile/Containers/Data/Application/2BA0F976-0A79-43E8-B5E6-28A8F0AE4D63/tmp/vladKarlugin.Documents-Inbox/Car%20Configurator.pdf

Im get file name from path "Car%20Configurator.pdf", but true name is "Car Configuration"

How can I'm decode name?

vadian :

Create an URL, delete the path extension and get the last path component.

let fileName = URL(string: urls[0])!.deletingPathExtension().lastPathComponent

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=390999&siteId=1