1

I have been trying to find out how to do this for days now, so I am finally asking how. I am newish to programming. Here is my problem.

I am trying to extract x,y,z coordinates from a text file arranged as such:

x,y,z
x,y,z
x,y,z
etc.

I need to be able to extract the x column into an array, the y into an array, and the z into an array. I learned how to pull it into a string, and how to split for every line, but I don't know how to split after each comma and separate them.

1 Answer 1

1

The String.Split function will split text by a selected character into an array of Strings.

Dim values As String() = line.Split(","c)
Dim x As Integer = Integer.Parse(values(0))
Dim y As Integer = Integer.Parse(values(1))
Dim z As Integer = Integer.Parse(values(2))
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.