3 var value = require('../../object/valid-value');
5 module.exports = function (search, replace) {
6 var index, pos = 0, str = String(value(this)), sl, rl;
7 search = String(search);
8 replace = String(replace);
11 while ((index = str.indexOf(search, pos)) !== -1) {
12 str = str.slice(0, index) + replace + str.slice(index + sl);