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

    If searchValue is a string, String.prototype.replace only replaces a single occurrence of the searchValue, whereas String.prototype.replaceAll replaces all occurrences of the searchValue …

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

    In JavaScript, strings are immutable, which means the best you can do is to create a new string with the changed content and assign the variable to point to it.

  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 …

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

  5. Efficient Javascript String Replacement - Stack Overflow

    Jan 20, 2017 · Explore efficient methods for replacing strings in JavaScript, including examples and best practices, discussed by the Stack Overflow community.

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

  7. Javascript - how to replace a sub-string? - Stack Overflow

    String.replace() is regexp-based; if you pass in a string as the first argument, the regexp made from it will not include the ‘g’ (global) flag. This option is essential if you want to replace all …

  8. Does javascript have a method to replace part of a string without ...

    var string = "This is a string"; string = string.replace("string", "thing"); Of course this will just make the code look a bit cleaner and still create a new string.

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

    Apr 28, 2017 · 25 i need to replace a part of a string in Javascript The following example should clarify what i mean

  10. How to replace an apostrophe in a string in Javascript?

    40 var str = "this's kelly" str = str.replace(/'/g, 'A'); The reason your version wasn't working is because str.replace returns the new string, without updating in place. I've also updated it to …