/**
 * @id $Id: jquery.pp.js 137 2010-09-10 11:46:18Z stefan.schult $
 */

/**
 * matching String starts with str
 * @param str
 */
String.prototype.startsWith = function(str) {
	return (this.match("^" + str) == str);
};

/**
 * matching String ends with str
 * @param str
 */
String.prototype.endsWith = function(str) {
	return (this.match(str + "$") == str)
};

/**
 * Trim
 */
String.prototype.trim = function() {
	return
	(this.replace(/^[\s\xA0]+/, "").replace(/[\s\xA0]+$/, ""));
};


$.inArrayStartsWith = function(b, a) {
	for (var i = 0, al = a.length; i < al; i++)
		if (a[i].startsWith(b))
			return i;
	return -1;
};

