Check if string is numeric in one line of code
<p>I'm working with a DNN form-building module that allows for some server-side code to be run based on a condition. For my particular scenario, I need my block of code to run if the first 4 characters of a certain form text are numeric.</p>

<p>The space to type the condition, though, is only one line and I believe gets injected into an <code>if</code> statement somewhere behind the scenes so I don't have the ability to write a mult-line conditional.</p>

<p>If I have a form field called <code>MyField</code>, I might create a simple conditional like this:</p>

<pre><code>[MyField] == "some value"
</code></pre>

<p>Then somewhere behind the scenes it gets translated to something like <code>if("some value" == "some value") {</code></p>

<p>I know that <code>int.TryParse()</code> can be used to determine whether or not a string is numeric but every implementation I've seen requires two lines of code, the first to declare a variable to contain the converted integer and the second to run the actual function.</p>

<p><strong>Is there a way to check to see if the first 4 characters of a string are numeric in just one line that can exist inside an <code>if</code> statement?</strong></p>