js从URL中截取文件名

js截取文件名

var img="http://pdfzhq.com/uploads/app/file/2022062116425486613.docx"

var str = img.substring(img.lastIndexOf('/') + 1)

结果:2022062116425486613.docx

THE END