Idiom #55 Convert integer to string
Create the string representation s (in radix 10) of the integer value i.

def s = "$i".toString()
While any of the Java examples works in Groovy, too, you can also use string interpolation like shown here.
String interpolation ("$i") gives you a GString, which in many places can be used as a string because it is a CharSequence. Here, for clarity, the GString is converted to a String using the toString() method.
String interpolation ("$i") gives you a GString, which in many places can be used as a string because it is a CharSequence. Here, for clarity, the GString is converted to a String using the toString() method.