String realName="F:/and/c.Txt.txt.d";
//获取扩展名
String extension = realName.substring(realName.lastIndexOf('/'),realName.indexOf("."));
String truename = extension.replace("/", "");
System.out.println(truename);
String oldpath = "/mnt/sdcard/PartySchollFil/index.gif";
System.out.println(oldpath.replace(oldpath.substring(oldpath.lastIndexOf("/")+1,oldpath.lastIndexOf(".")),"abc"));