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. javascript - Fastest method to replace all instances of a character in ...

    Jan 22, 2010 · What is the fastest way to replace all instances of a string/character in a string in JavaScript? A while, a for-loop, a regular expression?

  3. 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 occurences of a …

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

  6. How to use replaceAll() in Javascript - Stack Overflow

    26 This question already has answers here: How do I replace all occurrences of a string? (50 answers)

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

    Sep 26, 2010 · Particularly because he is doing this in JavaScript, and replacing the space character (but not other whitespace) with the + character is a standard way to encode URLs. This is probably …

  8. How to create a string "replace all" function? - Stack Overflow

    You want to not treat regex like regex? Can you define the types of input you'd like to provide? Will you want regex-functionality, or is it just a string of literal characters, "ABc34*\d/4h" you want to work …

  9. Replace all instances of character in javascript - Stack Overflow

    May 5, 2016 · Replace all instances of character in javascript Asked 14 years ago Modified 8 years, 11 months ago Viewed 35k times

  10. javascript - Case insensitive replace all - Stack Overflow

    14 When you use the regex solution you can get problems if your replace string contain e.g. "?". So you have to escape all regex characters or use e.g.: