截取字符串的一些方法
string strFileName = “aaa/bbb/ccc.html”
方法一:
string[] strSplit = strFileName.Split(new char[] { '.' });
string strUrl = strSplit[0].ToString(); //aaa/bbb/ccc
string strName = strSplit[1].ToString(); //html
方法二:
string strName = strFileName.Substring(strFileName.LastIndexOf("/") + 1);
string[] strSplit = strFileName.Split(new char[] { '/' });
string strUrl = "" ;
if (strSplit.Length > 1)
{
strUrl = strFileName.Substring(0, strFileName.LastIndexOf("/"));
}