﻿String.prototype.trim = function() {
    return this.replace(/^\s+|\s+$/g, "");
}

String.prototype.ltrim = function() {
    return this.replace(/^\s+/, "");
}

String.prototype.rtrim = function() {
    return this.replace(/\s+$/, "");
}

String.prototype.isEmpty = function() {
    return this == "";
}

String.prototype.isEmailAddress = function() {
    var expression = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
    return expression.test(this);
}
