Java tutorial
//package com.java2s; public class Main { public static String getNameFromFilepath(String filepath) { int pos = filepath.lastIndexOf('/'); if (pos != -1) { return filepath.substring(pos + 1); } return ""; } }