https://github.com/strarsis/str-replace-all
Replaces all occurences of a string in another string.
https://github.com/strarsis/str-replace-all
Last synced: 2 months ago
JSON representation
Replaces all occurences of a string in another string.
- Host: GitHub
- URL: https://github.com/strarsis/str-replace-all
- Owner: strarsis
- Created: 2015-09-14T21:13:54.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-24T16:19:33.000Z (over 9 years ago)
- Last Synced: 2025-02-17T08:43:23.901Z (5 months ago)
- Language: JavaScript
- Size: 9.77 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
str-replace-all
===============
Replaces all occurences of a string in another string.[](https://david-dm.org/strarsis/str-replace-all)
[](https://travis-ci.org/strarsis/str-replace-all)
[](https://nodei.co/npm/str-replace-all/)
Installation
------------
````
npm install --save str-replace-all
````Arguments
---------
### needle
The string to be searched for### replace
The string which replaces the needle string.### haystack
The string which is searched for the needle string.Usage
-----
````
var strReplaceAll = require('str-replace-all');
strReplaceAll('lorem ipsum lorem ipsum lorem ipsum', 'ipsum', 'lorem');
=> "lorem lorem lorem lorem lorem lorem"
````