i want to replace all "\n" caracters on mu string below by using replace(), but i think id doesn't enough.
look
Code: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
Code: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?



Reply With Quote


Bookmarks