Split and replace string
npm install splace



Split and replace string:
```
splace(string, replace[, excludeEmpty])
`ts
import { splace } from 'splace';
splace('Hello, world!', { world: 'person' }); // ['Hello, ', 'person', '!']
`
NPM:
`sh`
npm install splace
Yarn:
`sh`
yarn add splace
Import with ES modules:
`ts`
import { splace } from 'splace';
Require with CommonJS:
`ts`
const { splace } = require('splace');
Split and replace a word:
`ts`
splace('Hello, world!', { world: 'mate' });
// ['Hello, ', 'mate', '!']
Split and replace words:
`ts`
splace('Hello, world!', { Hello: "G'day", world: 'mate' });
// ["G'day", ', ', 'mate', '!']
Split and replace based on object order:
`ts`
splace('How much wood would a woodchuck chuck, if a woodchuck could chuck wood?', {
woodchuck: 'foo',
wood: 'bar',
chuck: 'baz',
}).join('');
// 'How much bar would a foo baz, if a foo could baz bar?'
Split and replace string with non-string values:
`ts`
splace('1 + 1 = 2', { 1: {}, 2: [] });
// [{}, ' + ', {}, ' = ', []]
Empty strings are removed by default. To keep empty strings:
`ts``
splace('foo', { foo: 'bar' }, false);
// ['', 'bar', '']
Release is automated with Release Please.