SyntaxFix
Write A Post
Hire A Developer
Questions
This can also get the filename
import java.nio.file.Paths; import java.nio.file.Path; Path path = Paths.get("/abc/def/ghfj.doc"); System.out.println(path.getFileName().toString());
Will print ghfj.doc
ghfj.doc