code: function(str, length, pruneStr){
        if (str == null) return '';
  
        str = String(str); length = ~~length;
        pruneStr = pruneStr != null ? String(pruneStr) : '...';
  
        if (str.length <= length) return str;
  
        var tmpl = function(c){ return c.toUpperCase() !== c.toLowerCase() ? 'A' : ' '; },
          template = str.slice(0, length+1).replace(/.(?=\W*\w*$)/g, tmpl); // 'Hello, world' -> 'HellAA AAAAA'
  
        if (template.slice(template.length-2).match(/\w\w/))
          template = template.replace(/\s*\S+$/, '');
        else
          template = _s.rtrim(template.slice(0, template.length-1));
  
        return (template+pruneStr).length > str.length ? str : str.slice(0, template.length)+pruneStr;
      }
docs: _s.prune: a more elegant version of truncate
  prune extra chars, never leaving a half-chopped word.
  @author github.com/rwz