Java tutorial
//package com.java2s; public class Main { private static String getFileNname(String str) { String name; try { name = str.substring(str.lastIndexOf("/"), str.lastIndexOf(".")) + ".jpg"; } catch (Exception e) { return null; } return name; } }