lhl 6ff0e96ad3 8-4-1 | 1 anno fa | |
---|---|---|
.. | ||
index.d.ts | 1 anno fa | |
index.js | 1 anno fa | |
license | 1 anno fa | |
package.json | 1 anno fa | |
readme.md | 1 anno fa |
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