String fileName="新建文件夹.txt";
int lastIndexOf=fileName.lastIndexOf(".")+1;
String suffix = fileName.substring(lastIndexOf);
System.out.println(suffix);
java获取文件后缀名
最新推荐文章于 2024-03-29 22:36:43 发布
String fileName="新建文件夹.txt";
int lastIndexOf=fileName.lastIndexOf(".")+1;
String suffix = fileName.substring(lastIndexOf);
System.out.println(suffix);