const replaceReange = require('replace-range');
const result = replaceRange('aaabbbcccdddeee', [
[3, 6, text => `<p>${text}</p>`],
[9, 12, text => `<i>${text}</i>`],
]);
console.log(result);
// aaa<p>bbb</p>ccc<i>ddd</i>eee
Replace a string of each range
nju33/replace-range
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Replace a string of each range
Topics
Resources
Stars
Watchers
Forks
Sponsor this project
Packages 0
No packages published