Here you can find the source of trim()
/**//from ww w .ja va 2 s. c o m * Trims whitespace off the string */ String.prototype.trim = function() { return this.replace(/^\s*/, "").replace(/\s*$/, ""); };
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._trimRE = new RegExp().compile(/^\s+|\s+$/g); String.prototype.trim = function() return this.replace(String._trimRE, "");
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;
String.prototype.trim = function(){ return this.rTrim(this.lTrim());