About 52 results
Open links in new tab
  1. javascript - How do I replace all occurrences of a string ... - Stack ...

    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('ab...

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

    160 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 object …

  3. How do I replace a character at a specific index in JavaScript?

    I have a string, let's say Hello world, and I need to replace the char at index 3. How can I replaced a char by specifying an index? var str = "hello world"; I need something like str.

  4. JavaScript replace() method dollar signs - Stack Overflow

    Aug 10, 2016 · 0 The replace method provides replacement patterns that start with a dollar sign. One of them is $$ which inserts a single $. A single dollar sign in the replacement string will result in a literal …

  5. How to replace substring in Javascript? - Stack Overflow

    Nov 27, 2016 · How to replace substring in Javascript? Asked 15 years, 2 months ago Modified 5 years, 1 month ago Viewed 50k times

  6. JavaScript replace/regex - Stack Overflow

    Jul 22, 2009 · 111 In terms of pattern interpretation, there's no difference between the following forms: /pattern/ new RegExp("pattern") If you want to replace a literal string using the replace method, I …

  7. how to replace \\ with \\\\ using javascript string functions

    Using regex it is hard to replace '/' with other string. So we can use String.replaceAll(). Source: link

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

    Dec 25, 2016 · The first call to the replace method is what puzzles me, I don't understand where the "$1" value comes from or what it means. I would think that the call should replace the found pattern with "".

  9. How can I perform a str_replace in JavaScript, replacing text in ...

    I want to use str_replace or its similar alternative to replace some text in JavaScript.

  10. How can I replace a regex substring match in Javascript?

    How can I replace a regex substring match in Javascript? Asked 15 years, 5 months ago Modified 1 year, 10 months ago Viewed 223k times