Read input in console

How to create a console application that will read input from the user and assign the input to a variable? The problem is that I need to enter several words on one line, separated by spaces of the type "ab cd efg", and then assign ab to one variable, cd to another variable and efg to another variable. Also entered words can be any.

+5
source share
3 answers
Dim input = Console.ReadLine()
Dim tokens As String() = input.Split(" ")
+11
source

Is this homework? I will answer from the answer too specific, but you will want to know more about Console.ReadLineand String.Split. We can start there.

+2
source

All Articles