Java tutorial
//package com.java2s; //License from project: Apache License public class Main { public static String getFileName(String str) { int index = str.lastIndexOf("/"); if (index > 0) { return str.substring(index + 1); } return str; } }