Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 13 days 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 (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-24T16:19:33.000Z (almost 9 years ago)
- Last Synced: 2024-10-18T23:55:20.305Z (about 1 month 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.[![david](https://david-dm.org/strarsis/str-replace-all.svg)](https://david-dm.org/strarsis/str-replace-all)
[![Build Status](https://travis-ci.org/strarsis/str-replace-all.svg)](https://travis-ci.org/strarsis/str-replace-all)
[![NPM](https://nodei.co/npm/str-replace-all.png?downloads=true&downloadRank=true&stars=true)](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"
````