F
francois
Hi,
I have an ArrayList object and I want to transform it into an array like
int[]
I of course do not want to loop myself
Then I thought that I could do the following:
ArrayList list = new ArrayList
.... // here fill the array with integers
int j = 3;
System.Type type = j.GetType();
list.ToArray(type)
My problem is that the ToArray method take a type object in parameter. And I
do not know how to get the type of Int32 without actually having the need to
create an instance?
Can someone tell me how to transform and ArrayList into an [] in the state
of the art way?
Thanks a lot,
francois
I have an ArrayList object and I want to transform it into an array like
int[]
I of course do not want to loop myself
Then I thought that I could do the following:
ArrayList list = new ArrayList
.... // here fill the array with integers
int j = 3;
System.Type type = j.GetType();
list.ToArray(type)
My problem is that the ToArray method take a type object in parameter. And I
do not know how to get the type of Int32 without actually having the need to
create an instance?
Can someone tell me how to transform and ArrayList into an [] in the state
of the art way?
Thanks a lot,
francois