title: How to check for a 10 digit number in a string
body: <p>In C, how do I check if a string read from a file contains a 10 digit number. I have used strspn and it seems to work, but I think there are better ways. Any help greatly appreciated.</p>
  
  <pre><code>char cset[] = "1234567890";
  do
  {  
  // read line into line_string       
  } while (strspn(line_string, cset) != 10);
  </code></pre>