0

Lets say I have a string like this:

"1,2,5,8"

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

1 Answer 1

3

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)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.