This discussion is archived
10 Replies Latest reply: Oct 16, 2012 10:37 PM by EJP RSS

Want to print new line by reading the string from Database

836548 Journeyer
Currently Being Moderated
Hi All,

I am facing a weired problem, When i write below code it is printing it in new line:
 StringBuffer sb = new StringBuffer(1024);
           sb.append("Hello, \n new line ");
           System.out.println(" The String is : "+sb.toString());
If i read the same data from Database (Database CharacterSet is ASCIITHAI ) and appending the string to StringBuffer
it is print like below one :

Hello, \n new line.

want to understand why it is not considering '\n' as newline when reading string from database.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points