Java tutorial
//package com.java2s; public class Main { private static String getExtension(String path) { int dot = path.lastIndexOf('.'); if (dot == -1) { return ""; } return path.substring(dot); } }