1. Introduction
Groovy has two ways of instantiating strings. One is plain java.lang.String
and the second is groovy.lang.GString
.
Plain string is represented with a single or double quote. However, the single quote doesn't support interpolation. Interpolation is supported only with a double quote, and when it is present, it becomes GString
. In this article, we will see the different types of string representations in Groovy and how to concatenate them.