String.prototype.trim = function() {
	// skip leading and trailing whitespace and return everything in between
	return this.replace(/^\s*(.*)/, "$1").replace(/(.*?)\s*$/, "$1");
}
String.prototype.isEmpty = function() {
	return this.trim().length>0;
}
String.prototype.equalsIgnoreCase = function(str) {
	return this.toLowerCase()==str.toLowerCase();
}
String.prototype.startsWith = function(str) {
	return this.match("^"+str)==str;
}
String.prototype.endsWith = function(str) {
	return this.match(str+"$")==str;
}
