xxxxxx(19) ;xxxx(28) ;xxx(35) ;
想要的结果是
19;28;35;

解决方案 »

  1.   

    string aa=xxxxxx(19);
    aa=aa.replace('x','').replace('(','').replace(')','');
      

  2.   

    string aa=xxxxxx(19);
    aa=aa。split(new char[]{'(',')'},stringsplitoption.removenullentity)[1]
      

  3.   

    Regex reg = new Regex(@"(?<=\()[^()]+(?=\))");
    MatchCollection mc = reg.Matches(yourStr);
    foreach (Match m in mc)
    {
       str+= m.Value + "\n";
     }
      

  4.   

    正则表达式 学的不怎么样! 来个笨正则
     string test = "x22xxxx(19);xxxx(28);xxx(35);xxx(21;";
                Regex reg=new Regex(@"\((\d+)\)");
                MatchCollection mm = reg.Matches(test);
                string str = string.Empty;
                for (int i = 0; i < mm.Count; i++)
                {
                    str += mm[i].Value + ";";
                }
                str.Replace("(", "").Replace(")", "");
      

  5.   


                string str = "xxxxxx(19) ;xxxx(28) ;xxx(35) ;";            Regex reg = new Regex(@"(?<=\().*?(?=\))");            foreach (Match m in reg.Matches(str))
                    Console.WriteLine(m.Value);