
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ""); };

String.prototype.isEmpty = function() { return new RegExp("^(\\s*)$","i").test(this); };

String.prototype.chopString = function(from,tooo) { return this.substring(from,this.length-tooo); }

String.prototype.getTagValue = function(tag){
	var regexp = new RegExp("<"+tag+">[\\s\\S]*(?=<\/"+tag+">)","ig");
	var result = this.match(regexp);
	if(result!=null) for(var i = 0; i < result.length; i++){
		result[i] = result[i].replace(new RegExp("^<"+tag+">([\\s\\S]*)$","i"),"$1").trim();
	}   
	return result==null ? result : result.length==1 ? result[0] : result;
}
