substring(s,s.indexof("/"))
怎么取得最后一个/我也不会

解决方案 »

  1.   


            Dim a As String = "http://www.xxx.com/a004.htm "
            MsgBox(a.Substring(a.LastIndexOf("/") + 1, (a.LastIndexOf(".") - a.LastIndexOf("/") - 1)))
      

  2.   

    strind url="http://www.xxx.com/a004.htm";
    string filename=url.substring(url.indexof("/"));结果 filename="a004.htm";随手写的没经过测试……
      

  3.   

    the following works too:string s = "...";
    s = System.IO.Path.GetFileNameWithoutExtension(s);
      

  4.   

    对不起应该是这样strind url="http://www.xxx.com/a004.htm";
    string filename=url.substring(url.LastIndexOf("/"));结果 filename="a004.htm";随手写的没经过测试……