How can I get file extensions with JavaScript?

来源:互联网 发布:vx软件 编辑:程序博客网 时间:2024/06/07 09:27

http://stackoverflow.com/a/25483772/2177408


If you are looking for a specific extension and know its length, you can use substr:

var file1 = "50.xsl";if (file1.substr(-4) == '.xsl') {  // do something}

0 0
原创粉丝点击