在字符串中有+CMTI: "MT",10,+CMTI: "MT",20之类的子串,怎么将它们全部提取出来

解决方案 »

  1.   

    "+CMTI: "MT",10,+CMTI: "MT",20".Split(",".ToCharArray());
      

  2.   

    ====================================================
    如果是+CMTI: "MT",n也是这样?
      

  3.   

    可能我没表达清楚,应该是字符串中有+CMTI: "MT","数字"这种格式的子串,我想把这些子串提取出来该怎么做
      

  4.   

    string test = @"+CMTI: ""MT"",10,+CMTI: ""MT"",20";
    MatchCollection mc = Regex.Matches(test, @"\+CMTI: ""MT"",\d+");
    foreach (Match m in mc)
    {
        m.Value;//这就是你要的
    }
      

  5.   

    过客博客
    http://blog.csdn.net/lxcnn
    RegExLab
    http://www.regexlab.com/zh/deelx/syntax.htm
      

  6.   

    过客博客
    http://blog.csdn.net/lxcnn
    RegExLab 
    http://www.regexlab.com/zh/deelx/syntax.htm