Javascript stringSplice
void function(root){
var splice = Array.prototype.splice;
function toString(value){ return String(value || '') }
function toArray(val){ return toString(val).split('') }
function stringSplice(original, from, length, change){
var org = toArray(original)
, chg = toArray(change)
splice.apply(org, [from, length].concat(chg)).join('')
return org
}
module.exports = stringSplice
}(this)
Written by Ashnur
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Javascript
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#