trimmest
Trims leading and trialing whitespace off of a string, with optional specified start and end indices.
Semantically equivalent to String.prototype.trim, but much faster for strings with little or no whitespace.
Also provides trimStart
/trimLeft
and trimEnd
/trimRight
methods.
Installation
npm install trimmest
Usage
var trimmest = // => '' // => '' // => 'test' trimmest // => 'test 'trimmest // => 'test ' trimmest // => ' test'trimmest // => ' test' // Optional start and end indices, which is convenient for trimming// during string parsing.// Whitespace will be trimmed around these indices. // => 'test2' // => 'test1'
License
MIT