title: How to declare the values of arrays in a switch statement in C#?
body: <p>I'm new to C# and I'm trying to figure out how I declare the values of arrays in switch statements. I'm used to using PHP and Javascript often and I can't figure out how I'd have to do this in C#. This is what I have right now:</p>
  
  <pre><code>string winkel = winkelDropdown.SelectedValue;
  ArrayList products = new ArrayList();
  output.Text = "Bij de " + winkel + " moet ik dit meenemen:&lt;br /&gt;";
  switch (winkel)
  {        
      case "Albert Heijn":
          products.Add("Boter");
          products.Add("Kaas");
          products.Add("Eieren");
          break;
      case "Jumbo":
          products.Add("Spek");
          products.Add("Lamsvlees");
          products.Add("Huiswijn");
          break;
      case "Plus":
          products.Add("Spaghetti");
          products.Add("Pastasaus");
          products.Add("Kaasbroodje");
          break;
      case "Emté":
          products.Add("Jupiler Krat");
          products.Add("Barbeque kolen");
          products.Add("Frisdrank");
          break;
  }
  foreach (string product in products)
  {
      output.Text += product + "&lt;br /&gt;";
  }
  </code></pre>
  
  <p>Is there a way in C# to make my switch statement shorter? For example something like this:</p>
  
  <pre><code>string[] productArray = string[3];
  switch (winkel)
  {        
      case "Albert Heijn":
          productArray = ["Boter", "Kaas", "Eieren"];
          break;
      case "Jumbo":
          productArray = ["Spek", "Lamsvlees", "Huiswijn"];
          break;
      case "Plus":
          productArray = ["Spaghetti", "Pastasaus", "Kaasbroodje"];
          break;
      case "Emté":
          productArray = ["Jupiler Krat", "Barbeque kolen", "Frisdrank"];
          break;
  }
  </code></pre>