public static String getExtension(String name) {int i = name.lastIndexOf('.');if (i == -1) {return "";}String ext = name.substring(i + 1);if (ext.equals("tmp")) {Matcher matcher = EXT_PATTERN.matcher(name.substring(0, i + 1));if (matcher.find()) {return matcher.group(1);}}return ext;}
public static string GetExtension(string name){int i = name.LastIndexOf('.');if (i == -1){return "";}return name.Substring(i + 1, name.Length - (i + 1));}