Answers for "string replace method"

31

javascript replace

var res = str.replace("find", "replace");
Posted by: Guest on October-21-2019
14

string replace java

public static void main(String args[]){  
String s1="my name is khan my name is java";  
String replaceString=s1.replace("is","was");//replaces all occurrences of "is" to "was"  
System.out.println(replaceString);  
}}
Posted by: Guest on April-08-2020
9

how to use the replace method in javascript

let string = 'soandso, my name is soandso';

let replaced = string.replace(/soandso/gi, 'Dylan');

console.log(replaced); //Dylan, my name is Dylan
Posted by: Guest on April-15-2020
3

javascript regex replace

const search = 'duck'
const replaceWith = 'goose';

const result = 'duck duck go'.replaceAll(search, replaceWith);

result; // => 'goose goose go'
Posted by: Guest on June-23-2020
6

str replace javascript all

str.replace(/abc/g, '');
Posted by: Guest on May-16-2020
6

replace all javascript

str.split(search).join(replacement);
Posted by: Guest on May-01-2020

Code answers related to "string replace method"

Code answers related to "Javascript"

Browse Popular Code Answers by Language