SyntaxFix
Write A Post
Hire A Developer
Questions
In Java 7 you have the new Paths api. The modern and cleanest solution is:
Paths.get("C:/aaa/bbb/ccc/ddd/test.java").getParent().getFileName();
Result would be:
C:/aaa/bbb/ccc/ddd