参考链接:https://blog.csdn.net/zhenyu5665/article/details/72829971
var fileName = "www.aaa.com/index.html"; 方法1 var fileExtension = fileName.substring(fileName.lastIndexOf(‘.‘) + 1); 方法2 var fileExtension =fileName.substring(fileName.length-3,fileName.length).toLowerCase(); 方法3 var fileExtension = fileName.split(‘.‘).pop().toLowerCase();
原文地址:https://www.cnblogs.com/beileixinqing/p/12420246.html
时间: 2024-11-05 16:00:22