I have a problem with REPLACE method for strings . I have a string witch contains 1 or 2 or ... same string and I want to replace all of them to one thing but replace method doesn't work , follow this :
var a = "hihi";
b = a.replace("hi","hello");
alert(b);
It should alert hellohello but it alerts hellohi .
Please help . Thanks .