Here you can find the source of trunc()
String.prototype.trunc = String.prototype.trunc || function(n){/*from w ww.j av a 2 s . c om*/ return (this.length > n) ? this.substr(0, n-1) + '…' : this; };
String.prototype.trunc = String.prototype.trunc || function(n){ return this.length>n ? this.substr(0, n-1) + '...' : this; }; function inArray(needle, haystack) { var length = haystack.length; for(var i = 0; i < length; i++) { if(haystack[i] == needle) return true; return false; ...
String.prototype.trunc = String.prototype.trunc || function(n){ return this.length>n ? this.substr(0, n-1) + '...' : this; }; function inArray(needle, haystack) { var length = haystack.length; for(var i = 0; i < length; i++) { if(haystack[i] == needle) return true; return false; ...
String.prototype.trunc = function(n,useWordBoundary){ var toLong = this.length>n, s_ = toLong ? this.substr(0,n-1) : this; s_ = useWordBoundary && toLong ? s_.substr(0,s_.lastIndexOf(' ')) : s_; return toLong ? s_ : s_; };
String.prototype.trunc = function(n,useWordBoundary) { var toLong = this.length>n , s_ = toLong ? this.substr(0,n-1) : this; s_ = useWordBoundary && toLong ? s_.substr(0,s_.lastIndexOf(' ')) : s_; return toLong ? s_ + '…' : s_; }; String.prototype.startsWith = function (str){ return this.slice(0, str.length) == str; }; ...
String.prototype.trunc = String.prototype.trunc || function(n){ return this.length > n ? this.substr(0,n-1) + "\u2026" : this; };
String.prototype.trunc = String.prototype.trunc || function(n){ return this.length>n ? this.substr(0,n-1)+'…' : this; };
String.prototype.truncar = function(number,cadena) { if(number < 0) return this; if(cadena){ return this.substr(0,number)+cadena; return this.substr(0,number);
String.prototype.truncate = function ( length, char ) { var _length = length || 18; return this.length > _length ? this.substring( 0, _length ).replace( /\s+$/g, '' ) + ( char || '?' ) : this;
String.prototype.truncate = function(){ var re = this.match(/^.{0,50}[\S]*/); var l = re[0].length; var re = re[0].replace(/\s$/,''); if(l < this.length) re = re + "..."; return re;