Android根據文件路徑獲取圖片的名字

String s="http://a0.att.hudong.com/15/37/20300415460903132947371591450.gif";
String temp[] = s.replaceAll("\\\\","/").split("/");
String fileName = "";
if(temp.length > 1){
   fileName = temp[temp.length - 1];
   System.out.println(fileName);
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章