I am working on android application. I am getting the image from gallery. Also I am getting the image path from gallery. Now my requirement is I want to get only the image name with the extension . How can I do that? Please help me.
String imgpath = "/mnt/sdcard/joke.png";
The image extension can be anything joke.png
or joke.jpeg
. I need to get the image name with extension finally.
i.e I want to split the above string and get only joke.png
.
How can I achieve that? Please help me in this regard.