Java tutorial
//package com.java2s; //License from project: Apache License public class Main { public static String getFileName(String path) { int start = path.lastIndexOf("/"); int end = path.lastIndexOf("."); if (start != -1 && end != -1) { return path.substring(start + 1, end); } else { return null; } } }