Groovy scripts raises an error:
def a = \"test\"
+ \"test\"
+ \"test\"
Error:
No signature of method: java.lang.String.
Similar to stripMargin(), you could also use stripIndent() like
def a = """\
test
test
test""".stripIndent()
Because of
The line with the least number of leading spaces determines the number to remove.
you need to also indent the first "test" and not put it directly after the inital """ (the \ ensures the multi-line string does not start with a newline).