title: Check if Array Position Exists
body: <p>I am trying to check if the position of an array exists or not.</p>
  
  <p>I am trying to output positions 1, 2, 3, 4 and 5 string values from a list. Where the list is less than 5, it needs to display a '-' as the string value.</p>
  
  <p>For example, a list of 3 should display: <code>Value, Value, Value, -, -</code></p>
  
  <p>I cannot however work out how to check this, and I keep getting index was out of range errors.</p>
  
  <p>I have tried:</p>
  
  <pre><code>if (String.IsNullOrEmpty(formGuideCount[3]))
  {
      game4 = formGuideCount[3];
  }
  else
  {
      game4 = "-";
  }
  </code></pre>
  
  <p>Can anyone tell me what I should be using to check if that position does not exist?</p>
  
  <p>Thanks</p>