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);
}
String temp[] = s.replaceAll("\\\\","/").split("/");
String fileName = "";
if(temp.length > 1){
fileName = temp[temp.length - 1];
System.out.println(fileName);
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
關於不推薦使用嵌套多於一個activity的解釋(用view代替)~~取自官方論壇
Nesting activities BY Joan Pujol | Post Datetime: Wed, 27 Apr 2011 03:43:07 GMT | #1/12 I've re
24小時熱門文章