forum

home / developersection / forums / split() function isn't giving output

Split() function isn't giving output

Anonymous User 1862 21-Aug-2014

Whats wrong in the code..? It isn't working!!

Actually I want to split the entries from one of the field of database.. The items in it are separated by commas..

Here is what I am doing.

string str = dataSet.Tables[0].Rows[0]["Ingredients"].ToString();
string[] split = str.Split(',');
IList<string> lblListItemIngredients  = new List<string>();
foreach (string item in split)
{
  lblListItemIngredients.Add(item);
}
and in my aspx page,
<ul>
<li>
<asp:label id="lblListItemIngredients" runat="server></asp:Label>
</li>
</ul>

But the output isn't coming, but in debugging mode, i can see the string is splitting.. Whats wrong?


Updated on 21-Aug-2014

I am a content writter !


Message
Can you answer this question?

Answer

1 Answers

Liked By