Bigfatty
Bigfatty

Reputation: 159

how do you convert an array from one data type to another in vb.net?

I'm using vb.net 2008 edition and i was wondering if there a way to convert an array type to another array type. For instance say i dim an array as string and then want to convert the array to the integer data type for sorting, how would i go about this?

Upvotes: 2

Views: 4318

Answers (1)

SLaks
SLaks

Reputation: 887225

You can call Array.ConvertAll:

intArray = Array.ConvertAll(stringArray, Function(s) Int32.Parse(s))

Upvotes: 3

Related Questions