ArrayList arr = new ArrayList();
string abc =
What should I do to convert arraylist to a string such as abc = arr;
Updated QuestOther consideration from which i can complete my work is concatination of string(need help in that manner ). suppose i have a
string s=”abcdefghi..”
by applying foreach loop on it and getting char by matching some condition and concatinating every char value in some insatnce variable of string type
i.e string subString=+;
Something like thisstring tem = string.Empty;
string temp =string.Empty;
temp = string.Concat(tem,temp);
Using a little linq and making the assumption that your
ArrayListcontainsstringtypes:Further reading:
http://msdn.microsoft.com/en-us/library/57a79xd0.aspx
For converting other types to string:
The first argument to the
Joinmethod is the separator, I chose whitespace. It sounds like your chars should all contribute without a separator, so use""orstring.Emptyinstead.Update: if you want to concatenate a small number of strings, the
+=operator will suffice:However, if you are planning on concatenating an indeterminate number of strings in a tight loop, use the
StringBuilder:This avoids the cost of lots of string creations due to the immutability of strings.