splice.js 181 B

1234567
  1. var chars = require('./chars');
  2. module.exports = function splice(str, i, howmany, substr) {
  3. var arr = chars(str);
  4. arr.splice(~~i, ~~howmany, substr);
  5. return arr.join('');
  6. };