1var str = "JavaScript replace method test";
2var res = str.replace("test", "success");
3//res = Javscript replace method success
1var str = "That is like so not cool, I was like totally mad.";
2var cleanStr = str.replace(/like/g, "");//replace every "like" with blank ""
1public static void main(String args[]){
2String s1="my name is khan my name is java";
3String replaceString=s1.replace("is","was");//replaces all occurrences of "is" to "was"
4System.out.println(replaceString);
5}}
6
1const search = 'duck'
2const replaceWith = 'goose';
3
4const result = 'duck duck go'.replaceAll(search, replaceWith);
5
6result; // => 'goose goose go'
1laptops["screen_size"] = laptops["screen_size"].str.replace('"','')
2print(laptops["screen_size"].unique())