When i run the following code, the output is not displaying in a new line but displays everything in a same line. Any advice please. I'm struggling but cant get it solved. this is kind of urgent any help is great...
StringBuffer s = new StringBuffer(4000);
s.append("Name: " + custNamerequestedAmt + "\n");
s.append("Phone: " + custPhone + "\n");
s.append("Email: " + custEmail + "\n");
s.toString();
Also I want to bold the headings of the column the name and phone, how can i acheive this.
-
String buffer help please (2 messages)
- Posted by: sirisha koka
- Posted on: November 09 2005 16:42 EST
Threaded Messages (2)
- String buffer help please by Gunjan Sharma on November 10 2005 03:17 EST
- String buffer help please by Fredrik Rubensson on November 10 2005 09:33 EST
-
String buffer help please[ Go to top ]
- Posted by: Gunjan Sharma
- Posted on: November 10 2005 03:17 EST
- in response to sirisha koka
I tried your code its working fine & output is displaying in a new line. -
String buffer help please[ Go to top ]
- Posted by: Fredrik Rubensson
- Posted on: November 10 2005 09:33 EST
- in response to sirisha koka
Another time it would be a good idea to post some more details about your problem. Since it may be that this is a homework I won't give an exact answer but rather give some guidance.
I would guess that you are trying to get some output on an HTML page. HTML is not supposed to care about newlines or white spaces when presenting its output so you have to find out how to do a newline in HTML and insert ít into the code. A good way to find ouy how HTML is written is to look at the source of any web page. Bote IE and Firefox has "view source" options in the menu. Nowadays not many developers put presentation logic like HTML tags in the JAva code but uses a presentation framework based on JSP to accomplish HTML output.
Good luck.