Convertir un ArrayList a string[]

Para convertir en C# un objecto ArrayList, definido como:

ArrayList arrayList = new ArrayList();

en un arreglo de strings (string[]), solo se necesita:

string[] stringArray = (string[])arrayList.ToArray(typeof(string));

Leave a Reply

Your email address will not be published. Required fields are marked *

Are you human? *