Yes, I answer my question, but I have not found it here yet and thought it was a pretty smooth thing:
... in VB.NET:
String.Join(",", CType(TargetArrayList.ToArray(Type.GetType("System.String")), String()))
... in C #
string.Join(",", (string[])TargetArrayList.ToArray(Type.GetType("System.String")))
The only βgain" for them is that an ArrayList should have items stored as strings if you use Option Strict to make sure the conversion is working properly.
EDIT: if you use .net 2.0 or higher, just create an object of type List (Of String) and you can get what you need. Thanks so much to Joel for this!
String.Join(",", TargetList.ToArray())
Dillie-O Oct 17 '08 at 18:30 2008-10-17 18:30
source share