str_replace

replace all occurrences of one string with another

Usage no npm install needed!

<script type="module">
  import strReplace from 'https://cdn.skypack.dev/str_replace';
</script>

README

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 :scream: str_replace(from, to, source [,ignoreCase]).

Install :hammer:

npm install str_replace

Usage :bulb:

var str_replace = require('str_replace');

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

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

Origin Credit :busts_in_silhouette:

Fagner Brack

License: MIT :unlock: