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?
String example = "/abc/def/ghfj.doc";
System.out.println(example.substring(example.lastIndexOf("/") + 1));