javascript截取文件名的后缀 front-end 2018-09-06 12345678const fileName="text.png";//带.的格式let fileFormat=fileName.substring(fileName.lastIndexOf('.'))// 不带.的格式let fileFormat2=fileName.substring(fileName.lastIndexOf('.')+1);console.log(fileFormat,fileFormat2) 转载请保持原始链接 原始链接: https://blog.v5pc.com/note/3d134670.html