format text

Hi,

I have got a paragraph of words that i retrieve from my database, I wanted to convert this paragraph to a single sentence, for example, i got

ABCD

EFGH

IJKL from my database into a String call first, then I like to reorganise the paragraph into ABCD EFGH IJKL and put in into String second, anyone has any idea on how to do this?

thx!

[385 byte] By [des_xu] at [2007-9-26 2:35:15]
# 1

what about:

suggest your string is named 'oldString'

String newString = oldString.replace('\n', ' ');

and / or:

String newString = oldString.replace('\r', ' ');

.. which substitutes newLine-character / return-character with a space.

Arne

ajwk at 2007-6-29 10:01:14 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...