string-mapreplace

0.1.5 • Public • Published

string-mapreplace

NOTE: string-mapreplace was renamed to @extra-string/map-replace. NPM

Replace parts of string using map.

const mapReplace = require('string-mapreplace');
// mapReplace(<string>, <map>)
 
mapReplace('alpha beta', new Map().set('alpha', 'α').set('beta', 'β'));
// 'α β'
mapReplace('gamma DELTA', new Map().set('gamma', 'γ').set('delta', 'δ'));
// 'γ DELTA'
mapReplace('Epsilon ZETA', new Map().set(/epsilon/gi, 'ε').set(/zeta/gi, 'ζ'));
// 'ε ζ'

Readme

Keywords

Package Sidebar

Install

npm i string-mapreplace

Weekly Downloads

1

Version

0.1.5

License

MIT

Unpacked Size

1.62 kB

Total Files

3

Last publish

Collaborators

  • wolfram77