Is String digit or alpha - Node.js String

Node.js examples for String:Parse

Description

Is String digit or alpha

Demo Code


function isAlnum( ch )
{
    if ( isAlpha( ch ) || isDigit( ch ) )
        return true;
    else// www. j a  v a  2 s .com
        return false;
}
function isAlpha( ch )
{
    if ( ((ch >= 'a') && (ch <= 'z')) || ((ch >= 'A') && (ch <= 'Z')) )
        return true;
    else
        return false;
}
function isDigit( ch )
{
    if ( (ch >= '0') && (ch <= '9') )
        return true;
    else
        return false;
}

Related Tutorials