12 lines
257 B
Text
12 lines
257 B
Text
|
|
static function isNumeric(n:String):Bool
|
||
|
|
{
|
||
|
|
if (Std.parseInt(n) != null) //Std.parseInt converts a string to an int
|
||
|
|
{
|
||
|
|
return true; //as long as it results in an integer, the function will return true
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
}
|