body:"""
Hi, how are you? Yes, I am doing good. what about you. How are things going?
Nothing interesting, as usual.
"""
In the above lines, I want to print a sentence in new line in groovy (body), how can I accomplish that? Note: I am new to groovy
I tried using b tag and nothing worked.
You have done it correctly...
body:"""Hi, how are you?
Yes, I am doing good.
what about you.
How are things going?
Nothing interesting, as usual."""
You can also ask the system for the correct line separator, since it can change on different operating systems.
writer << "Line 1" + System.getProperty("line.separator") + "Line 2"