Muqriz 48f16bfc3e initail first | il y a 4 mois | |
---|---|---|
.. | ||
node_modules/escape-string-regexp | il y a 4 mois | |
index.js | il y a 4 mois | |
license | il y a 4 mois | |
package.json | il y a 4 mois | |
readme.md | il y a 4 mois |
Trim a consecutively repeated substring:
foo--bar---baz
→foo-bar-baz
$ npm install --save trim-repeated
var trimRepeated = require('trim-repeated');
trimRepeated('foo--bar---baz', '-');
//=> 'foo-bar-baz'
trimRepeated('foo@#@#baz', '@#');
//=> 'foo@#baz'
Required
Type: string
Required
Type: string
Substring to trim.
condense-whitespace
- Remove leading, trailing and repeated whitespace from a stringMIT © Sindre Sorhus