sub-in
v1.0.2
Published
A tiny (115B) find-and-replace utility for strings in Javascript
Downloads
4
Readme
subIn
A tiny, fast utility function for string replacement in Javascript.
Usage
const greeting = 'Hey $0, how are you doing?'
subIn(greeting, ['Peter'])
// Hey Peter, how are you doing?
const friends = '$0, $1 and $2 are my friends.'
subIn(friends, ['Jake', 'Tom', 'Zack'])
// Jake, Tom and Zack are my friends