user3654442 user3654442 - 6 months ago 30 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)