Here you can find the source of trim()
// String object expansion methods. // Leading and trailing whitespaces trim regexp. String._trimRE = new RegExp().compile(/^\s+|\s+$/g); // Trims leading and trailing whitespaces. // Returns trimmed string. String.prototype.trim = function() { return this.replace(String._trimRE, ""); }
String.prototype.trim = function() { var str = this.replace(/^\s+/, ''); for (var i = str.length - 1; i >= 0; i--) { if (/\S/.test(str.charAt(i))) { str = str.substring(0, i + 1); break; return str; ...
String.prototype.trim = function() { return this.replace(/(^\s+)|(\s+$)/g, "");
String.prototype.trim = function() { a = this.replace(/^\s+/, ''); return a.replace(/\s+$/, ''); };
String.prototype.trim = function () { "use strict"; return this.replace(/^\s+|\s+$/g, ''); };
String.prototype.trim = function() { var re = /^\s+|\s+$/g; return this.replace(re, "");
String.prototype.trim = function() { return this.replace(/^\s*/, "").replace(/\s*$/, ""); };
console.log("'" + " a ".trim() + "'"); String.prototype.trim = function(){ return this.replace(/^\s+|\s+$/g, ''); }; console.log("'" + " b ".trim() + "'");
String.prototype.trim = function() var x=this; x=x.replace(/^\s*(.*)/, "$1"); x=x.replace(/(.*?)\s*$/, "$1"); return x;
var Firefox = (document.getElementById && !document.all); var MSIE = (-1 != navigator.userAgent.indexOf('MSIE')); String.prototype.trim=function(){ return this.replace(/^\s+|\s+$/g,""); }; function Redirect(url) parent.location=url; var Submitted = 0; function OnSubmit(form) if (Submitted) { return false; Submitted = 1; return true;