5

How to create a console application which would read input from user and assign the input to a variable? The problem is, I need to enter several words on one line separated with blank spaces like "ab cd efg" and then assign ab to one variable, cd to another variable and efg to another variable. Also the entered words can be any lenght.

3 Answers 3

14
Dim input = Console.ReadLine()
Dim tokens As String() = input.Split(" ")
Sign up to request clarification or add additional context in comments.

Comments

2

Is this homework? I'll keep the answer from being too concrete, but you will want to learn more about Console.ReadLine and String.Split. We can start there.

Comments

1

You can use Console.Read, Console.ReadLine and String.Split methods to accomplish this task.

Good luck.

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.