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.padRight = function(desiredLength, character) {
	if (character == undefined) {
		character = " ";
	}

	var paddedPart = "";
	for ( var i = 0; i < desiredLength - this.length; i++) {
		paddedPart += character;
	}
	return this + paddedPart;
};
String.prototype.padLeft = function(desiredLength, character) {
	if (character == undefined) {
		character = " ";
	}

	var paddedPart = "";
	for ( var i = 0; i < desiredLength - this.length; i++) {
		paddedPart += character;
	}
	return paddedPart + this;
};

