So you want `'\t Test \n\n'.replace(/^[ \t\n]+|[ \t\n]+$/g, '') === 'Test'`?
On Sat, Apr 22, 2017 at 6:41 AM, Cyril Auburtin <[email protected]> wrote: > Like some other languages (ex: python .strip, postgresql trim, ..) I think > it would really useful that `String.prototype.trim` accept a string > argument representing the characters to trim (or possible a regex). > > And keep it's default behavior if no argument is passed > > ```js > '\t Test \n\n'.trim(' \t\n') == 'Test' > ``` > > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss > >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

