Java获取文件的类型(扩展名)
时间:2014-10-09 20:49:27
收藏:0
阅读:239
File file=new File("E:\\aa.jpg"); String fileName=file.getName(); String fileTyle=fileName.substring(fileName.lastIndexOf("."),fileName.length()); System.out.println(fileTyle);
程序运行效果图:
评论(0)