string str = fileName.substring(fileName.lastIndexOf(".") + 1); 转载于:https://www.cnblogs.com/zhujiabin/p/5688801.html