str_replace

0.1.6 • Public • Published

str_replace NPM version Build Status Dependency Status License

Replace all occurrences of one string with another that according to Fagner is faster than regex. Functionality is available PHP form 😱 str_replace(from, to, source [,ignoreCase]).

Install 🔨

npm install str_replace

Usage 💡

var str_replace = require('str_replace');
var source  = 'okay.this.IS.a.string';

result = str_replace('.', '.', source);
console.log(result);                              // okay this IS a string

result = str_replace('is', 'AK', source, true);
console.log(result);                              // okay thAK AK a string

Origin Credit 👥

Fagner Brack

License: MIT 🔓

Readme

Keywords

none

Package Sidebar

Install

npm i str_replace

Weekly Downloads

2

Version

0.1.6

License

MIT

Last publish

Collaborators

  • angleman