获取文件后缀名类
public class GetFileExtUtil {
/**
* 获取文件扩展名
* @param path 文件路径
*/
public static String getExt(String path) {
if (path == null || path.equals("") || !path.contains(".")) {
return null;
} else {
return path.substring(path.lastIndexOf(".") + 1, path.length());
}
}
}
本文来自博客园,作者:CoderTL,转载请注明原文链接:https://www.cnblogs.com/codertl/p/15257946.html