kc-strrepl
v1.0.6
Published
[js] Replace all in string.
Downloads
7
Readme
STRRepl
[js] Replace all in string.
Install
npm install kc-strrepl
Use
var strrepl = require('kc-strrepl');
var srch = 'A'; // Search
var repl = 'B'; // Replace
var orig = 'A hello AA world A'; // Original string
var flag = 'gim'; // Regex flags (default: gim)
var str = strrepl(srch, repl, orig, flag);
console.log(str);