본문 바로가기
개발/JAVA

#writer에서 \n가 안먹힐때

by pastry 2014. 12. 16.

뉴라인이 안먹힐때

 

System.getProperty("line.separator")로 다음 라인으로 넘긴다.

 

ex)

PrintWriter pw = new PrintWriter(new FileWriter(filePath));

pw.write("글\n");

-->

pw.write("글"+System.getProperty("line.separator"));

댓글