![]() |
JTextPane: omitting new line (\n) character
Hi i have some code that searches elements of a jtextpane from one element to another looking for key words. However when i get a new keyword from a new line, a new line character proceeds it.
At least i assume that's what happened because I concatenated my keywork with a proceeding 'before' and preceeding 'after' and it came out like this before forafter instead of beforeforafter is there any way to check and remove the new line character from the keyword or any way to prevent it happening. Thanks. |
:
str = str.replaceAll("\\s", ""); |
Thanks for the answer i'll give it a try. Do you know if it will affect the way the document is saved and read back to the jtextpane?
|
If you perform the replace on the text inside the JTextPane, it will affect the way it is saved. An idea might be to keep an original copy of the text and create another copy to perform your string operations on.
|
| All times are GMT -5. The time now is 1:45 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC