Java tutorial
//package com.java2s; public class Main { /** * get full path * * @param filepath * @return */ public static String acquireNameFromFilepath(String filepath) { int pos = filepath.lastIndexOf('/'); if (pos != -1) { return filepath.substring(pos + 1); } return ""; } }