About 51 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 all occurrences in a string - Stack Overflow

    Aug 6, 2013 · Possible Duplicate: Fastest method to replace all instances of a character in a string How can you replace all occurrences found in a string? If you want to replace all the newline characters ...

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

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

  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. how to replace \\ with \\\\ using javascript string functions

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

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

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

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