In my GUI application, I have a JTextArea. I type the following
testone
testtwo
Now I do a getText() but I want to get rid of the newline between
testone and testtwo from the returned string. I did the following but
it doesn't work. If I print descrip after replaceAll, it still prints
in two lines.
String descrip = descrip_field.getText();
descrip.replaceAll("\n", "");
Babu Kalakrishnan - 24 Aug 2005 22:38 GMT
> In my GUI application, I have a JTextArea. I type the following
>
[quoted text clipped - 8 lines]
> String descrip = descrip_field.getText();
> descrip.replaceAll("\n", "");
Strings are immutable objects. You should be using the String that is
returned as the result of the replaceAll call.
BK
jobs239@hotmail.com - 24 Aug 2005 22:57 GMT
Thanks!
I used the returned string and it worked.