先用IndexOf找到字符的位置,再用 SubString去截取

解决方案 »

  1.   

    正则匹配例子
    string Example = "abcdefff";                string begin_str = "e";
                    string result = Regex.Match(Example, begin_str + @".*?$").Value;//efff
      

  2.   

    contains判断,indexof位置
    substring截取
      

  3.   

    string str1 = "asdcd";
    string str2 = str1.Remove(0, str1.IndexOf('s'));
      

  4.   

    string str = "abcdeaksdaslkd";
                str = str.Substring(str.IndexOf('d'), str.Length - str.IndexOf('d'));
      

  5.   


    static void Main(string[] args)
            {
                string str = "485269";
                char c = '8';
                Console.WriteLine(str.Substring(str.IndexOf(c)));
                Console.ReadLine();
            }