public class TestSubString {
public static void main(String[] args) {
String fileName = "upload/20191015/20191015163150_840.pdf";
String filePath = fileName.replace("/", "\\");
String docOldName = filePath.substring(filePath.lastIndexOf("\\") + 1);
System.out.println(docOldName);
}
}
网友评论