方法2:截取字符串中指定字符及其后面的字符 string s=”12345-3434”; s.Substring(0,s.LastIndexOf(“-“)); 使用这个方法: s.Substring(s.IndexOf(‘-‘)+1) s.Substring(0,s.IndexOf(“-“));