title: C# Loop Through An Array
body: <p>I am completely new to C#.  I am trying to loop through a short array, where the string elements in the array are placed at the end of a website search.  The code:</p>
  
  <pre><code>int n = 1;
  string[] s = {"firstitem","seconditem","thirditem"}
  int x = s.Max(); // note, from my research this should return the maximum value in the array, but this is the first error
  x = x + 1
  
  while (n &lt; x)
  {
  
        System.Diagnostics.Process.Start("www.website.com/" + b[0]);
  
        b[]++; // this also generates an error "identifier expected"
  
  }
  </code></pre>
  
  <p>My coding, logic or both are wrong.  Based on what I've read, I should be able to get the maximum value in an array (as an int), then add to the arrays value while a <code>WHILE</code> loop adds each value in the array at the end of the website (and then stops).  Note, that on the first error, I tried coding it differently, like the below:</p>
  
  <pre><code>int x = Convert.ToInt32(s.Max);
  </code></pre>
  
  <p>However, it generates an overload error.  If I'm reading things correctly, <code>MAX</code> should find the maximum value in a sequence.</p>