js得到文件后缀

function getFileExt(str)
{
var d=/\.[^\.]+$/.exec(str);
return d;
}

原文地址:https://www.cnblogs.com/lan0725/p/1873745.html