java 获取文件名(无后缀名) File file=new File("d:/a/aa/test.1.txt"); System.out.println(file.getName().replaceAll("[.][^.]+$", ""));