user3654442 user3654442 - 19 days ago 4x Question

Converting strings into an int array in visual basic?

Lets say I have a string like this:


How can I make a function in VB to turn that into an array of ints?


First split the string with the comma as separator and then convert each element in that resulting array into integer.

Dim ints = Array.ConvertAll("1,2,5,8".Split(","c), AddressOf Convert.ToInt32)