有这样的一组字符串:“001,002,003,004,005,006,007,008,009”.......可能更长的字符串,每一组数字都是用逗号隔开的,如果把这串字符串的每一组数字都提取出来并存入到一个数组中去????    help me!!!!

解决方案 »

  1.   

    String s1 = "001,002,003,004,005,006,007,008,009";
    String[] sA = s1.Split(",");
      

  2.   

    string [] split = null;
    split = YourString.Split(",");
      

  3.   

    string myStr = "001,002,003,004,005,006,007,008,009";
    string[] myAry = myStr.Split(',');
      

  4.   

    swordragon(古道热肠) 正解
    一般都定义一个char
    比如 
    string myStr = "001,002,003,004,005,006,007,008,009";
    char sp = (char)44;
    string[] strTmp;
    strTmp = myStr.Split(sp)
      

  5.   

    string myStr="001,002,003,004,005,006,007,008,009";
    char[] seperator=new char{','};
    string[] strTemp;
    strTemp=myStr.Split(separator);
      

  6.   

    错了,这一行
    char[] separator=char{','};
      

  7.   

    string myStr = "001,002,003,004,005,006,007,008,009";
    string[] myAry = myStr.Split(',');
      

  8.   

    string str = "001,002,003,004,005,006,007,008,009";
    string[] array = str.Split(',');