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

JS - replace character

0 votes
added May 31 in Javascript by azhaer Corporal (1,110 points)
//Replaces all spaces with '-'!
city_name=city_name.replace(/ /gi,'-');

1 Response

0 votes
responded May 31 by azhaer Corporal (1,110 points)
var text = "I love you no matter what";
var new_text = text.replace("love", "hate");
document.write(new_text); - Malaysia based Knowledge Exchange Platform, where you can share your finding or solution with other members of community.