peach a19a732be8 commit message | vor 2 Jahren | |
---|---|---|
.. | ||
index.d.ts | vor 2 Jahren | |
index.js | vor 2 Jahren | |
license | vor 2 Jahren | |
package.json | vor 2 Jahren | |
readme.md | vor 2 Jahren |
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