Java - How to get the name of a file from the absolute path and remove its file extension?

Viewed 2989

I have a problem here, I have a String that contains a value of C:\Users\Ewen\AppData\Roaming\MyProgram\Test.txt, and I want to remove the C:\Users\Ewen\AppData\Roaming\MyProgram\ so that only Test is left. So the question is, how can i remove any part of the string.

Thanks for your time! :)

3 Answers
Related