Java: Getting a substring from a string starting after a particular character

I have a string:

/abc/def/ghfj.doc

I would like to extract ghfj.doc from this, i.e. the substring after the last /, or first / from right.

Could someone please provide some help?

10 Answers
10

Leave a Comment