版权声明:本文为博主原创文章,转载请标明出处。 https://blog.csdn.net/chaoyu168/article/details/70332460
public String getFileName(String pathandname){
int start=pathandname.lastIndexOf("/");
int end=pathandname.lastIndexOf(".");
if(start!=-1 && end!=-1){
return pathandname.substring(start+1,end);
}else{
return null;
}
}