62,636
社区成员




System.out.println(file.getName().split("\\.")[0]);
System.out.println(file.getName().substring(0, file.getName().lastIndexOf(".")));
Pattern p=Pattern.compile("(.*)(\\.)(\\w+$)");
Matcher matcher=p.matcher(file.getName());
if (matcher.find()) {
System.out.println(matcher.group(1));
}
System.out.println(file.getName().split("\\.")[0]);
File f = new File("d:/d/abc.txt")
String fileName = f.getName();
Pattern pattern=Pattern.compile("\\\\(.+)\\.\\w+$");
Matcher matcher = pattern.matcher(fileName);
if(matcher.find())
{
System.out.println("fileName: " + matcher.group(1));
}
File f = new File("d:/d/abc.ccc.txt");