---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个,取剩下的所有字符
int i_s = filepath.LastIndexOf("\\");//最后一个\\前面有14个字符,所以i_s=14
string s = filepath.Substring(filepath.LastIndexOf("\\") + 1);//从第15个字符开始,不包括第15个,取剩下的所有字符

浙公网安备 33010602011771号