
function isBlank(s) {
    for(var i=0; i < s.length; i++) {
        var c = s.charAt(i);
        if ((c != ' ') && (c != '\n') && (c != '\t')) return false;
    }
    return true;
}

// Trims the spaces on the left hand side of the string
function ltrim(thisstring) {
    while(thisstring.charAt(0)==" ") {
        thisstring=thisstring.substring(1,thisstring.length);
    }
    return thisstring;
}

// Trims the spaces on the right hand side of the string
function rtrim(thisstring) {
    while(thisstring.charAt(thisstring.length-1)==" ") {
        thisstring=thisstring.substring(0,(thisstring.length-1));
    }
    return thisstring;
}

// Trims spaces from both sides of the string
function trim(thisstring) {
    thisstring=ltrim(thisstring);
    thisstring=rtrim(thisstring);
    return thisstring;
}

