peach a19a732be8 commit message | 2 anos atrás | |
---|---|---|
.. | ||
index.d.ts | 2 anos atrás | |
index.js | 2 anos atrás | |
license | 2 anos atrás | |
package.json | 2 anos atrás | |
readme.md | 2 anos atrás |
Trim newlines from the start and/or end of a string
$ npm install trim-newlines
const trimNewlines = require('trim-newlines');
trimNewlines('\n🦄\r\n');
//=> '🦄'
trimNewlines.start('\n🦄\r\n');
//=> '🦄\r\n'
trimNewlines.end('\n🦄\r\n');
//=> '\n🦄'
Trim from the start and end of a string.
Trim from the start of a string.
Trim from the end of a string.
String#trim()
but removes only whitespace on the leftString#trim()
but removes only whitespace on the right.MIT © Sindre Sorhus