title: Check if a value is in an array (C#)
body: <p>How do I check if a value is in an array in C#?</p>
  
  <p>Like, I want to create an array with a list of printer names.</p>
  
  <p>These will be fed to a method, which will look at each string in turn, and if the string is the same as a value in an array, do that action.</p>
  
  <p>For example:</p>
  
  <pre><code>string[] printer = {"jupiter", "neptune", "pangea", "mercury", "sonic"};
  foreach (p in printer)
  {
     PrinterSetup(p);     
  }
  </code></pre>
  
  <p>These are the names of the printers, they are being fed to the PrinterSetup method.</p>
  
  <p>PrinterSetup will look sort of like this (some pseudocode):</p>
  
  <pre><code>public void PrinterSetup(printer)
  {
     if (printer == "jupiter") 
     {
        Process.Start("BLAH BLAH CODE TO ADD PRINTER VIA WINDOWS EXEC");
     }
  }
  </code></pre>
  
  <p>How do I format <code>if (printer == "jupiter")</code> in a way that C# can recognize?</p>