How to get multiple inputs from user in a single line in C#

Updated on January 20, 2019 in [A] C# .Net
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
1 on January 20, 2019


In C++ We can take multiple inputs from a user in a single line. So My Question is how can we take multiple inputs from the user in C# without using loop.

Thanks in Advance

  • Liked by
  • Visual
0 on January 20, 2019

split up your input by the spaces, store them into an array and handle individually.
For example:

// user text is "Take sword"
String[] userInput = text.Split(' ');

userInput[0] is “Take” and userInput[1] is “sword”


  • Liked by