<?xml version="1.0" encoding="utf-8"?>
<s1 title="ParseInteger"><p></p>
<s2 id="ParseInteger" title="ParseInteger">
<p>See also: <jump href="/wiki/Math">Math</jump> for information of the &quot;Math&quot; class. </p>
<p>See also: <jump href="/wiki/Strings">Strings</jump> for information of the &quot;Strings&quot; class. </p>
<p><em><strong>usage:</strong></em> </p>
<source><![CDATA[ParseInteger("numerical String", Minimum value, [optional max value], [optional string end value])]]></source><p>Returns a number found in a string if the number meets all the criteria (more than or equal to min, less than or equal to max [if specified], and ending in string end value [if specified]). This could be used to extract a number from a string. </p>
<p><em><strong>examples:</strong></em> </p>
<p></p>
<source><![CDATA[echo ParseInteger("40", 50)]]></source><p>Will return: 40 because it found the number 40 in the string and the number is less than 50. </p>
<p></p>
<source><![CDATA[echo ParseInteger("40s", 0, 40, "s")]]></source><p>Will return: 40 because it found a number 40 in the string, the number 40 is more than 0 but less than or equal to 40 and ends in &quot;s&quot;. </p>
<p></p>
<source><![CDATA[echo ParseInteger("50s", 0, 100)]]></source><p>Will return: -1 because the string is not a number </p>

<br/>------------------------------------------------------------------------------<br/>
<p> <jump href="/wiki/CategoryFunctions">CategoryFunctions</jump> </p>
</s2></s1>