实现的功能:将一段字符串如:(1,22,3,66,96,6)这个字符串分割成1
22
3
66
96
6这样的字符串

解决方案 »

  1.   

    string s = "(1,22,3,66,96,6)";
            s = s.Replace('(');
            s = s.Replace(')');
            foreach (string ss in s.Split(','))
            {
                ss//你想要的分割后的字符串,作得理吧
            }
      

  2.   

    var str = "1,22,3,66,96,6";
    var str1 = str.split(",")
      

  3.   

    支持lihui_830501(阿狼) 的,顶一下
      

  4.   

    s = s.Replace('(','');
      

  5.   

    string s = "(1,22,3,66,96,6)";
            s = s.Replace('(');
            s = s.Replace(')');
            foreach (string ss in s.Split(','))
            {
                ss//你想要的分割后的字符串,作得理吧
            }
    不明白2楼的这个s = s.Replace('(');
            s = s.Replace(')');写法?括号好象不对称~
    lihui_830501(阿狼)能解释一下么谢谢。。
      

  6.   

    将一段字符串如:(1,22,3,66,96,6)
    dim strTemp as string = "将一段字符串如:(1,22,3,66,96,6)"
    dim str() as string = strtemp.Replace("(","").Replace(")","").Split(",")
    dim i as integer = 0
    for i=0 to str.length-1
       //输出内容 
      str(i)
    next
      

  7.   

    string str1="1,22,3,66,96,6"
    string str()=str1.split(",")
      

  8.   

    string[] str="1,22,3,66,96,6".Split(",");