Here you can find the source of Trim()
String.prototype.Trim = function() { /*from w ww . jav a2 s . c om*/ var m = this.match(/^\s*(\S+(\s+\S+)*)\s*$/); return (m == null) ? "" : m[1]; }
String.prototype.trim = jCube.String.trim = function () { return this.replace( /^\s+|\s+$|^\n+|\n+$|^\t+|\t+$/g, "");
String.prototype.Trim = function( aimStr ) var str = this; var re = My.RegExp.InvolvedCharsRegExp; var reStart, reEnd; if ( aimStr ) aimStr = aimStr.replace( re, '\\$1' ); reStart = new RegExp( '^(' + aimStr + ')+' ); ...
String.prototype.Trim = function(){ return this.replace(/(^\s*)|(\s*$)/g, ""); };
String.prototype.Trim = function() { return this.lTrim().rTrim(); };
String.prototype.Trim = function(){ return this.replace(/(^\s*)|(\s*$)/g,""); };
String.prototype.Trim = function(charlist) { return this.lTrim(charlist).rTrim(charlist); };