Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Groovy
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.
S : String := Integer'Image (I);

New implementation...