string=“COL_01,COL_02,COL_03,COL_04,COL_05”
遇到‘,’ 就分开

解决方案 »

  1.   

    你写的那个string是什么啊,定义一个字符串没有写完整吧
    string _Str =“COL_01,COL_02,COL_03,COL_04,COL_05”遇到逗号分开string [] _Array = _Str.Split(',');
    这样就可以了,按“,”分割后保存在数组_Array中。
      

  2.   


    string s="COL_01,COL_02,COL_03,COL_04,COL_05";
    string[] ss = s.Split(","); 
    foreach(string sss in ss)
    {
        Response.Write(sss+"</br>");
    }
      

  3.   

    请问大家delphi 改怎么截取
      

  4.   

    不好意思,Split里使用的是单引号string s="COL_01,COL_02,COL_03,COL_04,COL_05";
    string[] ss = s.Split(','); 
    foreach(string sss in ss)
    {
        Response.Write(sss+"</br>");
    }
      

  5.   

    照你这么说楼主看我我这样写行不:
    string s="COL_01,COL_02,COL_03,COL_04,COL_05";
    s.replace(",","</br>")
    呵呵,我想效果是一样的
      

  6.   

    delphi参考:
    http://topic.csdn.net/t/20041022/11/3480680.html
      

  7.   


    string s="COL_01,COL_02,COL_03,COL_04,COL_05";
    string[] ss = s.Split(','); 
    foreach(string sss in ss)
    {
        Response.Write(sss+"</br>");
    }
      

  8.   


         string[] sArray = s.Split(',');