.. | ||
.npmignore | ||
.travis.yml | ||
Gruntfile.js | ||
package.json | ||
README.md | ||
replaceall.js | ||
replaceall.min.js | ||
spec.js |
replaceall
![devDependency Status](https://david-dm.org/leecrossley/replaceall/dev-status.png)
Replace all instances in a JavaScript string.
Install with npm
npm install replaceall
To then include replaceall in your node app:
var replaceall = require("replaceall");
Using replaceall
var result = replaceall("instances of this", "with this string", "in this string");
Example
var original = "hello world goodbye world";
replaceall("world", "everyone", original);
// "hello everyone goodbye everyone"
replaceall("l", "z", original);
// "hezzo worzd goodbye worzd"