java 写文本换行

import org.apache.commons.io.FileUtils;
    public static void main(String[] args) throws IOException {
        File file = new File("c:\\1\\2\\3\\4.txt");
        FileUtils.writeStringToFile(file, "1:\r\n", false);
        FileUtils.writeStringToFile(file, "2:\r\n", true);
        FileUtils.writeStringToFile(file, "3:\r\n", true);
    }

 

posted @ 2017-01-05 10:59  爱畔畔真是太好了  阅读(773)  评论(0编辑  收藏  举报