/*
 * $Id: string.js 45 2009-09-27 07:19:26Z wru $
 */

String.prototype.eraseTrailingSpaces = function ()
{
    return (this.replace (/\s*$/, ""));
}

String.prototype.isEmpty = function ()
{
    return (this.eraseTrailingSpaces ().length == 0);
}

String.prototype.isNumeric = function ()
{
    return (/^\s*[+-]?(\d+(\.\d*)?|\.\d+)([Ee][+-]?\d+)?\s*$/.test (this));
}

String.prototype.isInteger = function ()
{
    return (this.isNumeric () && parseFloat (this) == parseInt (this, 10));
}
