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
I came across this question and inspired by other contributors. I need to append some content to a file once per line. Here is what I did.
class Doh {
def ln = System.getProperty('line.separator')
File file //assume it's initialized
void append(String content) {
file << "$content$ln"
}
}
Pretty neat I think :)