title: How to check if all strings in a string array are all digits?
body: <p>I have a string, and I want it to be only digits. I tried this, using <code>LINQ</code>:</p>
  
  <pre><code>string[] values = { "123", "a123" };
  bool allStringsContaintsOnlyDigits = true;
  
  foreach(string value in values)
  {
      if(!value.All(char.IsDigit))
      {
          allStringsContaintsOnlyDigits = false;
          break;
      }
  }
  
  if(allStringsContaintsOnlyDigits) { /* Do Stuff */ }
  </code></pre>
  
  <p>But a loop for only two strings (and it is guaranteed that I have two strings) is a bit tedious...</p>
  
  <p>So I thought maybe doing this:</p>
  
  <pre><code>if(values[0].All(char.isDigit) &amp;&amp; values[1].All(char.isDigit)) { /* Do Stuff */ }
  </code></pre>
  
  <p>But is there a more elegant way? Something like:</p>
  
  <pre><code>values.All(char.IsDigit) // for all strings
  </code></pre>
  
  <p>Thanks.</p>
  
  <p><strong>Note:</strong> negative numbers need to be rejected. Meaning: <code>-125</code> should return <code>false</code>.</p>