title: Why do I get System.String [ ] in my code while debugging?
body: <p>I am on my final project in c# for beginners, but I can't seem to get my list to work properly. It also closes automatically after being 'filled' with orders. </p>
  
  <pre><code>class Burgare
  {
      private string[] hamburger = new string[24];
      private int no_burger = 0;
  
  
  
  
  
      public void add_burger()//Ordering of burgers
      {
          Console.Clear(); //Clears console to make it look cleaner
          while (true)
          {
              int Burger_option = 0;
              do
              {
                  Console.WriteLine("");// The options user can choose from
                  Console.WriteLine("Please choose burgers from our menu:");
                  Console.WriteLine("-------Burgers--------");
                  Console.WriteLine("1 Original One     109");
                  Console.WriteLine("2 Pig &amp; Cow        109");
                  Console.WriteLine("3 Spice &amp; Nice     109");
                  Console.WriteLine("4 Green One        109");
                  Console.WriteLine("0 Go back to main menu");
                  Console.WriteLine("----------------------");
                  Console.WriteLine("");
  
  
  
                  try //Making sure the user only picks what is on the menu
                  {
                      Burger_option = int.Parse(Console.ReadLine());
                  }
  
                  catch
                  {
                      Console.WriteLine("You can only choose what is on the menu!");
  
  
                  }
  
                  switch (Burger_option) //Depending on the number user presses on keyboard different burgers will be added to order
                  {
                      case 1:
                          Console.WriteLine("You've added the Original One to your order");
                          Console.WriteLine("If you're done press 0 to go back to the main menu");
                          hamburger[no_burger] = "Original One";
                          break;
  
                      case 2:
                          Console.WriteLine("You've added the Pig &amp; Cow to your order");
                          Console.WriteLine("If you're done press 0 to go back to the main menu");
                          hamburger[no_burger] = "Pig &amp; Cow";
                          break;
  
                      case 3:
                          Console.WriteLine("You've added the Spice &amp; Nice to your order");
                          Console.WriteLine("If you're done press 0 to go back to the main menu");
                          hamburger[no_burger] = "Spice &amp; Nice";
                          break;
  
                      case 4:
                          Console.WriteLine("You've added the Green One to your order");
                          Console.WriteLine("If you're done press 0 to go back to the main menu");
                          hamburger[no_burger] = "Green One";
                          break;
  
                      case 0: //Sends user back to main menu
                          Run();
                          break;
                  }
                  no_burger++; //Adds burger
  
              } while (no_burger != 0);
  
              if (no_burger &lt;= 25) //Maximum number of orders
              {
                  Console.WriteLine("The restaurant can't take more than 24 orders of burgers at the time");
                  Run(); //Sends user back to main menu when the order is over 24
              }
          }
      }
  
  
  
      public void print_order()
      {
  
          Console.WriteLine("-Your current order-");
  
  
  
      foreach (var burger in hamburger) //Showing a list of what is in the order
          {
           Console.WriteLine(hamburger);
  
           if (burger != null)
  
                  Console.WriteLine(burger);            
           else
                  Console.WriteLine("Empty space"); //Making empty space to show where you can add more burgers
          }
  
      }
  </code></pre>
  
  <p>After entering 24 orders I get the error "System.IndexOutOfRangeException: 'Index was outside the bounds of the array.'" I've looked around a bit but still don't really understand how to fix my code. I'd like for it to return to the main menu after telling the user the order is full.</p>
  
  <p>For my second problem the System.String [] problem, it appears when I enter the 'print_order'. It shows itself as
  System.String []
  Empty space
  System.String []
  Empty space
  And so on. If possible I'd like to either remove it completely or at least replace it with 1,2,3...etc.</p>