top of page

Groovy: Multi-line Strings

In Groovy there are three ways to define multi-line Strings

Method 1: Triple Quote def multiLineString = """Line 1 Line 2 Line 3""" Method 2 def multiLineString = new String( "Line 1" + "Line 2" + "Line 3")

Method 3 def multiLineString = "Line 1" + "Line 2" + "Line 3" Method 1 is the best and most true Groovy way of defining multi-line Strings in Groovy.

Is there any other way to define multi-line String in Groovy then please comment?

663 views0 comments

Recent Posts

See All

Docker - Introduction Docker is an open source platform for developers & sysadmins to build, ship and run distributed applications; whether on laptops, VM's or cloud. Steps to Install Docker on Ubuntu

What is reCAPTCHA? reCAPTCHA is a powerful service to detect against spam & abuse and can very easily help your distinguish between an actual site visitor or a bot. reCAPTCHA is a free service provide

bottom of page