JAVA小知識——換行的幾種方式

1、java中的轉義符"\r\n" String str="aaa"; str+="\r\n"; 這樣在str後面就有換行了。 注意:\r,\n的順序不能對換,不然不能實現換行的效果。java 2、BufferedWriter的newline() FileOutputStream fos=new FileOutputStream("c;\\11.txt"); BufferedWriter bw=n
相關文章
相關標籤/搜索