Venkat S

Venkat S

  • 1.5k
  • 234
  • 202.7k

how to split string dynamically

Jun 14 2011 5:00 AM
Hai Friends,

   i want to dispaly data in textbox like
id:111
name:venkat
color:green
so befor i display only for data like
111
venkat
green
.................
now i want to display like this
<pre lang="midl">id:111
name:venkat
color:green</pre>
here is my code

<pre lang="cs">string str2 = &quot;&quot;;
            string[] strListItems;
            int intNumItems = comboBox1.Items.Count;
            strListItems = new string[intNumItems];
            for (int i = 0; i &lt; comboBox1.Items.Count; i++)
            {
                strListItems[i] = ds.Tables[0].Rows[comboBox1.SelectedIndex][i].ToString();
                str2 = str2 + &quot;\r\n &quot; +strListItems[i];
            }
            textBox1.Text = str2;</pre>

Please give me any idea.


Thanks
Venkat.S

Answers (8)