I have a text area which is filled from database. In that textarea comma’s are replaced by white space using this.
document.getElementById('<%=fnl000Db000MESSAGE.ClientId %>').value=document.getElementById('<%=fnl000Db000MESSAGE.ClientId %>').value.replace(/,/g,'\s');
Now I want to insert a new a new line after first two words like this..
eg.. hello admin ‘\n’ welcome
how can i get this using javascript. Do i need to use Regex or any other way.
I want an output like
Hello Admin
Process are running…
This isn’t all fancy like a regex, but I find it easier to read =).
http://jsfiddle.net/Pfx3P/