String.prototype.right_size = function(a, b){
	return this.length>=a && this.length<=b;
}

String.prototype.has_phone = function(){
	return /([0-9-]){7,20}/.test(this);
}

String.prototype.has_html = function(){
	return /<.*?>/.test(this);
}

String.prototype.is_int = function(){
	return  /^([0-9]+)$/.test(this);
}

String.prototype.is_blank = function(){
	return  this.trim().length == 0;
}

String.prototype.is_right_number_list = function(){
	return /^([0-9,，])*$/.test(this);
}

String.prototype.is_right_phone = function(){
	var r = /^(^0[0-9]{2,3}\-[0-9]{7,8}$)|(^0[0-9]{2,3}\-[0-9]{7,8}\-[0-9]{1,4}$)|(^[0-9]{7,8}$)|(^[0-9]{7,8}\-[0-9]{1,4}$)|(^0[0-9]{2,3}[0-9]{7,8}$)|(^0[0-9]{2,3}[0-9]{7,8}\-[0-9]{1,4}$)|(^0{0,1}13[0-9]{9}$)|(^0{0,1}15[0-9]{9}$)$/;
	return r.test(this);
}

String.prototype.is_right_email = function(){
	var r = /^[0-9a-zA-Z\-\.\_]+@[0-9a-zA-Z\-]+\.[0-9a-zA-Z\-\.]+$/;
	return r.test(this);
}


String.prototype.trim = function(){
    return this.replace(/(^[\s]+)|([\s]+$)/g, "");
};
String.prototype.format = function(){
    var str = this;
    for (var i = 0; i < arguments.length; i++) {
        var re = new RegExp('\\{' + (i) + '\\}', 'gm');
        str = str.replace(re, arguments[i]);
    }
    return str;
};
