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 🔓

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.6
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.6
    2
  • 0.1.5
    1
  • 0.1.4
    1
  • 0.1.3
    1
  • 0.1.2
    1

Package Sidebar

Install

npm i str_replace

Weekly Downloads

5

Version

0.1.6

License

MIT

Last publish

Collaborators

  • angleman