Here you can find the source of trimj()
/*/* w ww .j av a 2s .c om*/ Description: Trims string with leading and trailing spaces off Syntax: String.trim() Returns: A string with leading and trailing spaces off Sample: " I am the best and girls love me! ".trim() == "I am the best and girls love me!" */ String.prototype.trim = jCube.String.trim = function () { return this.replace( /^\s+|\s+$|^\n+|\n+$|^\t+|\t+$/g, ""); }
String.prototype.trimToLength = function(m) { return (this.length > m) ? jQuery.trim(this).substring(0, m).split(' ').slice(0, -1).join(' ') : this.replace('"', ''); };
String.prototype.trimToPx = function(length) var tmp = this; var trimmed = this; if (tmp.visualLength() > length) trimmed += "..."; while (trimmed.visualLength() > length) tmp = tmp.substring(0, tmp.length-1); trimmed = tmp + "..."; return trimmed;
String.prototype.trimTrailZeroes = function() { return this.replace(/(.\d*?)0+$/, "$1").replace(/\.$/, ""); };
var trim_ = function (str) { return str.replace(/(^\s*)|(\s*$)/g, ""); };
String.prototype.trimfast = function() { var str = this.replace(/^\s\s*/, ''), ws = /\s/, i = this.length; while (ws.test(this.charAt(--i))); return str.slice(0, i + 1); }; (function($){ $.fn.trimval = function() { ...
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,""); };