Java tutorial
//package com.java2s; public class Main { public static String getPathName(String path) { int index = path.lastIndexOf('/'); if (index == -1 || index == 0) return path; return path.substring(index + 1); } }