smansakra
02-19-2009, 05:12 AM
i want to replace all "\n" caracters on mu string below by using replace(), but i think id doesn't enough.
look
var string = "hello... \n my name is reni \n i live at indonesia \n i 'm still a girl\n nice to meet you....";
my function is below
function replace_this(string){
string.replace('\n', '<br>');
return string;
}
but i the result is just return
hello... <br> my name is reni \n i live at indonesia \n i 'm still a girl\n nice to meet you....
i think just the first "\n" character that replaced not all character.
how to replace all "\n" character?
look
var string = "hello... \n my name is reni \n i live at indonesia \n i 'm still a girl\n nice to meet you....";
my function is below
function replace_this(string){
string.replace('\n', '<br>');
return string;
}
but i the result is just return
hello... <br> my name is reni \n i live at indonesia \n i 'm still a girl\n nice to meet you....
i think just the first "\n" character that replaced not all character.
how to replace all "\n" character?