截取倒数第二个文件夹名称 D:\web\test\t.txt 截取结果:test java pdfPath.substring(pdfPath.lastIndexOf(File.separator,pdfPath.lastIndexOf(File.separator)-1)+1,pdfPath.