To remove empty lines from string
807589Jul 28 2008 — edited Jul 29 2008Hi,
In my application, when I open a paeg, am getting the javascript werror such as " Run time error. do you wish to debug? Unterminated String constant" . I understood that, the textarea had blank lines in between. The solution I got from net was to Disable script chacking in Tools->Advanced tab. But I would like to fix it from my java code.
The code which I used is..
int pos;
String a;
while(((pos=temp.indexOf("\n")) > 0 ))
{
a=temp.substring(pos+1).trim();
temp=temp.substring(0,pos)+a;
}
Even though, it is removing the blank lines before inserting data into database, I am gettign the same error again n again.
Could anyone help me out?
Thanks