title: C#: How to detect arguments typed into console application?
body: <p>How would I go upon detecting input for a console application in C#?</p>
  
  <p>Let's say for example I want the console application to start up by writing:
  Welcome To Food Hut
  (cursor to type stuff here after the first line)</p>
  
  <p>I would want the console application to detect two commands:</p>
  
  <p>1: /help - which will display some help gibberish.</p>
  
  <p>2: /food pizza -t pepperoni -d pepsi - which will display "So you would like a Pizza with Pepperoni and Pepsi to drink?"</p>
  
  <p>How would I go upon detecting first what /command was typed and also reading the arguments like -t pepperoni (topping) and -d pepsi (to drink) if /food pizza was typed?</p>
  
  <p>My main problem is figuring out how to detect the first word ever typed, figuring out that if it was /help then call some method that would post some help text into the console or if the command is /food then to read what is after the /food command, -t, and -p.</p>
  
  <pre><code>    static void Main(string[] args)
      {
          Console.WriteLine("Welcome To Food Hut");
          Console.ReadLine();
  
          // if readline equals to /help then display some help text.
  
  
          // if /food command is typed, read first argument after /food Pizza, -t TheTopping
          // and -p ForWhatToDrink
  
          // and then display, 'So you would like a Pizza with Pepperoni and Pepsi to drink?'
      }
  </code></pre>