Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

To remove empty lines from string

807589Jul 28 2008 — edited Jul 29 2008
Hi,
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 26 2008
Added on Jul 28 2008
14 comments
1,874 views