//获取文件名
String temp[] = userModel.getImageurl().replaceAll("\\\\","/").split("/");
String myFileName="";
if (temp.length > 1) {
myFileName=temp[temp.length - 1];
}
本文介绍了一种从完整文件路径中提取文件名的方法,通过Java代码实现,适用于需要解析文件路径的应用场景。
//获取文件名
String temp[] = userModel.getImageurl().replaceAll("\\\\","/").split("/");
String myFileName="";
if (temp.length > 1) {
myFileName=temp[temp.length - 1];
}
1438

被折叠的 条评论
为什么被折叠?