Here you can find the source of trim()
// -------------------------------------------------------------------------- \\ // File: String.js \\ // Module: IEPatches \\ // Author: Neil Jenkins \\ // License: ? 2010-2015 FastMail Pty Ltd. MIT Licensed. \\ // -------------------------------------------------------------------------- \\ /*jshint strict: false */ /**// w w w . j a v a2 s . c om Method: String#trim Returns the string with any white space at the beginning and end removed. Implementation by Steven Levithan: <http://blog.stevenlevithan.com/archives/faster-trim-javascript> Returns: {String} The trimmed string. */ String.prototype.trim = function () { var str = this.replace( /^\s\s*/, '' ), ws = /\s/, i = str.length; while ( ws.test( str.charAt( i -= 1 ) ) ) {/* Empty! */} return str.slice( 0, i + 1 ); };
function cutFixedNum(value,num){ var value_str = "" + value; var index = value_str.indexOf('.'); if (index!=-1){ value_str = value_str.substring(0,index+num+1); return value_str; String.prototype.trim = function() ...
var Person = function() { this.omdb_id this.name this.character this.job String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ''); }; ...
String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/g, ""); }; String.prototype.trim = function() { var start = 0, end = this.length - 1, ws = /\s/; while (ws.test(this.charAt(start))) { start++; ...
String.prototype.trim = function() var res = this; while (res.substring(0, 1) == " ") { res = res.substring(1, res.length); while (res.substring(res.length - 1, res.length) == " ") { res = res.substring(0, res.length - 1); return res;
String.prototype.trim = function () { return this .replace(/^\s\s*/, '' ).replace(/\s\s*$/, '' ); function isEmpty(str){ if(str == null || str== undefined || str.trim().length == 0) return true; else return false;
String.prototype.trim = function () { var str = this.replace( /^\s\s*/, '' ), ws = /\s/, i = str.length; while ( ws.test( str.charAt( i -= 1 ) ) ) {} return str.slice( 0, i + 1 ); };
String.prototype.trim = function () { return this.replace(/^\s+|\s+$/g,''); }; String.prototype.ltrim = function() { return this.replace(/^\s+/,''); }; String.prototype.rtrim = function() { return this.replace(/\s+$/,''); }; ...
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ''); } function isProbablyUrl(string) { var substr = string.substring(0,4).toLowerCase(); if (substr == 'ftp:' || substr == 'www.') return true; var substr = string.substring(0,5).toLowerCase(); if (substr == 'http:') return true; var substr = string.substring(0,6).toLowerCase(); if (substr == 'https:') return true; var substr = string.substring(0,7).toLowerCase(); ...
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, "");