3 var indexOf = String.prototype.indexOf, slice = String.prototype.slice;
5 module.exports = function (search, replace) {
6 var index = indexOf.call(this, search);
7 if (index === -1) return String(this);
8 return slice.call(this, 0, index) + replace +
9 slice.call(this, index + String(search).length);