code: function trim (string) {
        string = string.replace(/(^\s*)|(\s*$)/gi,"");
        string = string.replace(/[ ]{2,}/gi," ");
        string = string.replace(/\n /,"\n");
        return string;
      }
docs: TOOLBOX