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

    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. 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.

  3. 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 …

  4. 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 "".

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

    Aug 10, 2016 · 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 …

  6. 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.

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

    Nov 27, 2016 · 3 replace only replace the first occurrence of the substring. Use replaceAll to replace all the occurrence.

  8. 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 …

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

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

  10. 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