title: What is the C# equivalent of NaN or IsNumeric?
body: <p>What is the most efficient way of testing an input string whether it contains a numeric value (or conversely Not A Number)? I guess I can use <code>Double.Parse</code> or a regex (see below) but I was wondering if there is some built in way to do this, such as javascript's <code>NaN()</code> or <code>IsNumeric()</code> (was that VB, I can't remember?).</p>
  
  <pre><code>public static bool IsNumeric(this string value)
  {
      return Regex.IsMatch(value, "^\\d+$");
  }
  </code></pre>