About 5,700,000 results
Open links in new tab
  1. JavaScript to replace variable in a string - Stack Overflow

    May 3, 2016 · I want to write a function to replace variables in a string with actual values, for example: function replaceUrl(url, data) {} The caller may be: …

  2. JavaScript String replace() Method - W3Schools

    The replace() method searches a string for a value or a regular expression. The replace() method returns a new string with the value(s) replaced. The replace() method does not change the …

  3. String.prototype.replace() - JavaScript | MDN - MDN Web Docs

    Apr 28, 2025 · The replace() method of String values returns a new string with one, some, or all matches of a pattern replaced by a replacement. The pattern can be a string or a RegExp, and …

  4. JavaScript Replace – How to Use the String.prototype.replace() …

    Feb 8, 2022 · Basic Syntax of the String.prototype.replace() Method const variable = variable.replace("stringToReplace", "expectedString"); You use the replace() method by: …

  5. Find/Replace Text in JavaScript with replace() [Examples]

    May 29, 2022 · This quick tutorial will show you how to find and replace text in JavaScript, with code examples.

  6. Javascript find and replace string with variable values

    var string = 'This is some content: {{field[10]}}'; var submission.inputs[10] = 'replace value'; I want the new string to be this. var newString = 'This is some content: replace value'; This is running …

  7. JavaScript string replace() Method - GeeksforGeeks

    Jun 26, 2024 · JavaScript replace() method is used for manipulating strings. It allows you to search for a specific part of a string, called a substring, and then replace it with another substring.

  8. JavaScript: String replace() method - TechOnTheNet

    This JavaScript tutorial explains how to use the string method called replace() with syntax and examples. In JavaScript, replace() is a string method that is used to replace occurrences of a …

  9. How to replace a character in a string using JavaScript

    Oct 23, 2022 · You can use the replace() method to replace the occurrence of a character inside a string in JavaScript. Here is an example that replaces a character in a string with another …

  10. An In-Depth Guide to String.replace() in JavaScript

    Oct 30, 2023 · In this comprehensive guide, we‘ll thoroughly cover all aspects of replace() to solidify your understanding. We‘ll look at techniques like chaining replaces, using complex …

  11. Some results have been removed
Refresh