/mnt/sdcard/VideosZip/1339730718.wmv, /mnt/sdcard/VideosZip/list.xml 前面是一个数组里面的数据,我得到/mnt/sdcard/VideosZip/list.xml 这个字符。还有我不知道我要得到的字符在数组中位置?

解决方案 »

  1.   

    我要得到/mnt/sdcard/VideosZip/list.xml 。
      

  2.   

    意思是一个数组 
    String[] s = {/mnt/sdcard/VideosZip/1339730718.wmv, /mnt/sdcard/VideosZip/list.xml}然后你要得到以  .xml 结尾的字符串?
    除了遍历我觉得无解
      

  3.   

    数组的每个元素都要遍历的吧,不然怎么知道.xml呢
      

  4.   

    你是想问怎么使遍历的效率高些?还是想问除了遍历有没有其它算法可以打到以 .xml 结尾的字符串?
      

  5.   

    怎么遍历得到.xml结尾的字符串!??
      

  6.   

    遍历了得到了两个字符串/mnt/sdcard/VideosZip/1339730718.wmv,和/mnt/sdcard/VideosZip/list.xml ,那我改怎么判断得到.xml文件?
      

  7.   


    直接取最后3个substring看是否equals(xml),最原始的办法
      

  8.   

    谢谢各位啦,我使用的是这个endsWith(".xml")!