8 lines
222 B
JavaScript
8 lines
222 B
JavaScript
/**
|
|
* Alternative to the standard String.prototype.replace function
|
|
* Avoids problems with $$, $1, $2, ...
|
|
*/
|
|
|
|
module.exports = function(str, searched, replacement) {
|
|
return str.split(searched).join(replacement);
|
|
}; |