Created
July 2, 2017 21:53
-
-
Save chekit/023d7722803a3169664f4c2181003529 to your computer and use it in GitHub Desktop.
Для замены нескольких совпадений в тексте на нужный шаблон можно использовать метод replace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let text = 'test'.replace(/t/gi, '<span>$&</span>'); | |
// text = "<span>t</span>es<span>t</span>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment