Join an ArrayList
- From: "kevin" <kevin@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 24 Aug 2005 14:25:18 -0700
I need to join the elements of an arraylist into a comma delimited list and
have been doing the following
string[] x = new string[myArrayList.Count];
myArrayList.CopyTo(x);
string.join(",",x);
I tried string.join(",",myArrayList.ToArray(typeof(string))); but the
compiler complained about converting from an object to a string array.
Is there another, i.e. shorter, way to do this?
Kev
.
- Follow-Ups:
- Re: Join an ArrayList
- From: Frank Dzaebel
- Re: Join an ArrayList
- From: Bruce Wood
- Re: Join an ArrayList
- Prev by Date: using System.Reflection to invoke private method ColumnHeaderClick
- Next by Date: Re: Firing cross thread events...
- Previous by thread: Double buffering a groupbox
- Next by thread: Re: Join an ArrayList
- Index(es):
Relevant Pages
|