0.3.0 • Published 10 years ago

str-replace-all v0.3.0

Weekly downloads
197
License
MIT
Repository
github
Last release
10 years ago

str-replace-all

Replaces all occurences of a string in another string.

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"