string Ta="哈哈,刘大哥,无奈,死人";
怎么得到
哈哈
刘大哥
无奈
死人

解决方案 »

  1.   

    string[] a=Ta.spilt(',');
    a[0]就是哈哈,以此类推
      

  2.   


    string [] arr=Ta.Split(new char[]{','});
    foreach(string str in arr){
      System.out.WriteLine(str);
    }
      

  3.   

    LS已经说了,用String.Split()方法就好了
      

  4.   

     TextBox4.Text = GridView1.SelectedRow.Cells[4].Text.ToString();  //列得到值
            SqlDataAdapter da = new SqlDataAdapter("select * from 开考课程 where 级别='" + DropDownList级别.SelectedValue.ToString() + "' order by 本次码", cnnDB);
            DataSet ds = new DataSet();
            da.Fill(ds);
            CheckBoxList1.DataSource = ds;
            CheckBoxList1.DataTextField = "课程及代码";
            CheckBoxList1.DataValueField = "本次码";
            string[] a = TextBox4.Text.Split(',');
            foreach(string str in a){
                if (CheckBoxList1.DataValueField == str)
                {
                    CheckBoxList1.SelectedValue = true;
                }
            }帮我看看  这段有错没
      

  5.   

     TextBox4.Text = GridView1.SelectedRow.Cells[4].Text.ToString();  //列得到值
            SqlDataAdapter da = new SqlDataAdapter("select * from 开考课程 where 级别='" + DropDownList级别.SelectedValue.ToString() + "' order by 本次码", cnnDB);
            DataSet ds = new DataSet();
            da.Fill(ds);
            CheckBoxList1.DataSource = ds;
            CheckBoxList1.DataTextField = "课程及代码";
            CheckBoxList1.DataValueField = "本次码";
            string[] a = TextBox4.Text.Split(',');
            foreach(string str in a){
                if (CheckBoxList1.DataValueField == str)
                {
                    CheckBoxList1.SelectedValue = true;
                }
            }
      

  6.   

    我想  从我的字符里 比较VALUE值相同不  如果相同 
    就把checkbox勾选