About 12,800,000 results
Open links in new tab
  1. How do I replace all occurrences of a string? - Stack Overflow

    5515 Given a string: string = "Test abc test test abc test test test abc test test abc"; This seems to only remove the first occurrence of abc in the string above: string = string.replace('abc', ''); …

  2. JavaScript: replace last occurrence of text in a string

    Apr 28, 2010 · JavaScript: replace last occurrence of text in a string Asked 15 years, 5 months ago Modified 1 year, 8 months ago Viewed 226k times

  3. How to replace part of a string using regex - Stack Overflow

    Apr 28, 2017 · You'll need to complete a few actions and gain 15 reputation points before being able to upvote. Upvoting indicates when questions and answers are useful. What's reputation …

  4. javascript - How to replace captured groups only? - Stack Overflow

    The parenthesis are used to create "groups", which then get assigned a base-1 index, accessible in a replace with a $, so the first word (\w+) is in a group, and becomes $1, the middle part …

  5. javascript - Replace multiple characters in one replace call - Stack ...

    159 If you want to replace multiple characters you can call the String.prototype.replace() with the replacement argument being a function that gets called for each match. All you need is an …

  6. How to replace " with \" in javascript - Stack Overflow

    How to replace " with \" in javascript Asked 14 years, 2 months ago Modified 9 years, 10 months ago Viewed 58k times

  7. javascript replace() is not replacing all the characters match

    Aug 7, 2013 · @MattBall In most languages, using replace lets you replace a string with a string, instead of needing a regex every time. the subject.split (search).join (replacement) construct is …

  8. JavaScript String replace vs replaceAll - Stack Overflow

    Apr 28, 2021 · ECMAScript 2021 has added a new String function replaceAll. A long time ago in a galaxy not so far away, people used split + join or regular expressions to replace all …

  9. Javascript replace method, replace with "$1" - Stack Overflow

    Dec 25, 2016 · Javascript replace method, replace with "$1" Asked 15 years, 2 months ago Modified 8 years, 9 months ago Viewed 76k times

  10. javascript - Replace all spaces in a string with - Stack Overflow

    Sep 26, 2010 · @JitendraPancholi he wants to replace spaces, not "white spaces." In this context I assume by spaces he means only the space character, not just any old whitespace like /s …