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
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
You can use Console.Read, Console.ReadLine and String.Split methods to accomplish this task.
Good luck.