String.prototype.contains = function(t) { return this.indexOf(t) >= 0; }
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ""); }
String.prototype.isStr = function() { var str = this.trim(); return str.length > 0; }
String.prototype.isAlpha = function() { var rx = new RegExp("^[a-zA-Z]+$"); var matches = rx.exec(this); return (matches != null && this == matches[0]); }
String.prototype.isNum = function() { var rx = new RegExp("^\\d+$"); var matches = rx.exec(this); return (matches != null && this == matches[0]); }
String.prototype.isAlphaNum = function() { var rx = new RegExp("^\\w+$"); var matches = rx.exec(this); return (matches != null && this == matches[0]); }
String.prototype.isEmail = function() { var rx = new RegExp("\\w+([-+.\’]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*"); var matches = rx.exec(this); return (matches != null && this == matches[0]); }
String.prototype.isPhone = function() { var rx = new RegExp(/\d{3}-\d{3}-\d{4}$/); var matches = rx.exec(this); return (matches != null && this == matches[0]); }
