Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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"
````