JavaScript S

15 · David Walsh · Dec. 27, 2021, 10:30 p.m.
Replacing a substring of text within a larger string has always been misleading in JavaScript. I wrote Replace All Occurrences of a String in JavaScript years ago and it’s still one of my most read articles. The confusion lies in that replace only replaces the first occurrence of a substring, not all occurrences. For example: […] The post JavaScript S appeared first on David Walsh Blog. ...