﻿//	-----   feel free to use this stuff   ---   play with it   ---   copy as You  like   -----
//	-----   but leave this authors 2 lines untouched:   pseliger@gmx.net  [june 2003]    -----
//
//	extended javascript-api-methods		:
//	* jsApi-extension-name / file-name	: "jsApi.String.trim.js"
//	* original download-location		: "http://www.pseliger.de/jsExtendedApi/jsApi.String.trim.js"
//
//	last revision		: june 2003		- code of all methods, I belief, is on its edge now;
//										- no further revision planned (pure code=425 bytes);
//	third revision		: march 2003	- there was some overengineering done to the code;
//	second revision		: february 2003	- code of "leftTrim" gets improved;
//										- introducing a new function "removeWhiteSpaces";
//	first revision		: january 2003	- the pure js-code has now 452 bytes only;
//	first public release: august 2002	- the pure js-code comes with 1.255 bytes;
//
String.prototype.removeWhiteSpaces = function(){return(this.replace(/\s+/g,""));};
// does what the methods name promisses;
String.prototype.leftTrim = function(){return(this.replace(/^\s+/,""));};
// - schneidet alle fuehrenden white-spaces einer zeichenkette ab;	- cuts all leading white-spaces of a string;
String.prototype.rightTrim = function(){return(this.replace(/\s+$/,""));};
// - schneidet alle einer zeichenkette folgenden white-spaces ab;	- cuts all trailing white-spaces of a string;
String.prototype.basicTrim = function(){return(this.replace(/\s+$/,"").replace(/^\s+/,""));};
// - kombiniert "leftTrim" und "rightTrim";							- combination of the above 2 functions "leftTrim" and "rightTrim";
String.prototype.superTrim = function(){return(this.replace(/\s+/g," ").replace(/\s+$/,"").replace(/^\s+/,""));};
// - wie "basicTrim" - zusaetzlich werden alle white-spaces inner-	- behaves like "basicTrim" - additionally all white-spaces within
//   halb einer zeichenkette auf jeweils ein "blank"  "eingedampft;	  a string  are forced to shrink  each to a  single-"blank"-space;
//
//	------------------------------------------------------------------------------------------
//	------------------------------------------------------------------------------------------
