title: Check if a char matches any char in a char array
body: <p>Essentially, I'm trying to check if <code>textbox2.Text</code> contains anything that isn't an integer. This is an incredibly inefficient way of doing it, but it's the only way I could figure out. Is there anything better that I could do?</p>
  
  <pre><code>char[] ca = textBox2.Text.ToCharArray();
  foreach (char c in ca)
  {
      string s = "1234567890";
      char[] ca2 = s.ToCharArray();
      if (c != ca2[0] &amp;&amp; c != ca2[1] &amp;&amp; c != ca2[2] &amp;&amp; c != ca2[3] &amp;&amp; c != ca2[4] &amp;&amp;
          c != ca2[5] &amp;&amp; c != ca2[6] &amp;&amp; c != ca2[7] &amp;&amp; c != ca2[8] &amp;&amp; c != ca2[9])
      {
          MessageBox.Show("Non-integer detected in text box.");
          EndInvoke(null);
      }
  }
  int i = int.Parse(textBox2.Text);
  </code></pre>