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.
Dim input = Console.ReadLine()
Dim tokens As String() = input.Split(" ")
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.
You can use Console.Read, Console.ReadLine and String.Split methods to accomplish this task.
Good luck.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With