---lastIndexOf

string filepath = "ALow\\K-1s\\2006\\arex1.txt";
int i_s = filepath.LastIndexOf("\\");//最后一个\\前面有14个字符,所以i_s=14
string s = filepath.Substring(filepath.LastIndexOf("\\"+ 1);//从第15个字符开始,不包括第15个,取剩下的所有字符
posted @ 2009-05-09 15:13  shuang  阅读(304)  评论(0)    收藏  举报