Java tutorial
//package com.java2s; public class Main { public static String getNameFromFileName(String name) { int index = name.lastIndexOf("."); if (index != -1) { name = name.substring(0, index); } return name; } }