String.implement({
    
	isNumeric: function(value) {
        return this.match(/^\d+$/) != null;
	},

    isAlpha: function(value) {
        return this.match(/^[a-zA-Z]+$/) != null;
    },
	
	getNumeric: function() {
    	return this.replace(/\D/g, "");
	},

	getAlpha: function() {
		return this.replace(/[^a-zA-Z]/g, "");
	},
	
	leftPad: function(size, pad) {
	    var newValue = this;
	    while (newValue.length < size) {
	        newValue = pad + newValue;
	    }
	    return newValue;
	},
	
    insert: function(index, newValue) {
        var len = this.length;
        var value = this;
        var a = (index <= 0) ? "" : value.substr(0, index);
        var b = (index >= len) ? "" : value.substr(index, len-index);
        return a + newValue + b;
    },

    isEmpty: function() {
        return this.trim().length == 0;
    }

});
