Java tutorial
//package com.java2s; public class Main { public static String getTitleFromPath(String path) { int startIndex = path.lastIndexOf("/"); int endIndex = path.lastIndexOf("."); if (startIndex < 0 || endIndex < 0) { return ""; } return path.substring(startIndex + 1, endIndex); } }