Groovy write to file (newline)

前端 未结 5 1542
你的背包
你的背包 2020-12-24 01:05

I created a small function that simply writes text to a file, but I am having issues making it write each piece of information to a new line. Can someone explain why it puts

5条回答
  •  不知归路
    2020-12-24 01:51

    It looks to me, like you're working in windows in which case a new line character in not simply \n but rather \r\n

    You can always get the correct new line character through System.getProperty("line.separator") for example.

提交回复
热议问题