Reputation:
I have a TextArea and a few lines of text in it. When I extract String by getText() method what I`m getting is a line of text instead of really written few lines. So what can I do to distinguishevery line in TextArea?
Upvotes: 0
Views: 9117
Reputation: 56
Use the .replaceAll like this,
//replace the line breaks "\n" with System line separator...
//replace "yourTextAreaVariabe" with your own...
yourTextAreaVariable.getText().replaceAll("\n", System.getProperty("line.separator"));
Upvotes: 0