Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

JS - replace character

0 votes
7 views
added May 31, 2018 in Javascript by azhaer Corporal (1,070 points)
edited Jul 13, 2018 by LC Marshal
//Replaces all spaces with '-'!
city_name=city_name.replace(/ /gi,'-');

1 Response

0 votes
responded May 31, 2018 by azhaer Corporal (1,070 points)
edited Jul 13, 2018 by LC Marshal
var text = "I love you no matter what";
var new_text = text.replace("love", "hate");
document.write(new_text);
lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...