Convert the arraylist into string with a delimiter

2 06 2009

Hi,

You can convert an arraylist data to a string type and store it into a string variable. To do this use this sample code.

ArrayList al = new ArrayList();
al.Add("Hi");
al.Add("How R U?");
string str = "";
for (int i = 0; i < al.Count; i++)
{
    str = str + al[i].ToString() + ",";
}

Regards,
Manoranjan Sahoo
Mail id: manoranjan.sahoo@gmx.com


Actions

Information

Leave a comment