Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Unable to print line space between 2 string values

StringBuilder ac = new StringBuilder();
ac = ac.append(cu.getFieldText("Text1"));
ac = ac.append("\n");
ac = ac.append(cu.getFieldText("Text2"));
ac = ac.append("\n");

When i am passing ac.toString() value to the another textArea the values are printing on the same row instead of printing like below

abc
<<line space>>
efg

Tried with below:
1. ac.append("\n");
2. ac.append("\r\n");
3. ac.append(System.getProperty("line.separator"));

above 3 ways are working fine and printing the correct out put on the console but printing all the text in the same line when passed it to the text area. Please help me.

0 votes


Accepted answer

Permanent link
If you mean an HTML presentation when using the term "text area", you need to use the tag < br > for a new line.
Mahesh Vasamsetti selected this answer as the correct answer

1 vote

Comments

  ac = ac.append("<br>"+cu.getFieldText("Text1")+"</br>");

 ac = ac.append("<br>"+cu.getFieldText("Text2")+"</br>");

This is working for me. Thnx

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Aug 03 '15, 1:46 a.m.

Question was seen: 1,700 times

Last updated: Aug 04 '15, 8:12 a.m.

Confirmation Cancel Confirm