81,094
社区成员
发帖
与我相关
我的任务
分享
public static void main(String[] args) {
String path = "E:C\\company\\WebRoot\\images\\botton-cz.jpg";
System.out.println("Path:" + path);
String[] array = path.split("\\\\"); // 相当于两个\\ ,正则要求,仔细体会
System.out.println("File Name:" + array[array.length - 1]);
}