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.
@(...) converts a plain-C value to its object representation; the description message converts any object to its string representation.
uses SysUtils;
var
_s: String;
_i: Integer;
begin
_s := IntToStr(_i);
end.
Str(i,s);
No dependecies on any library. Should work in all Pascal dialects.
my $s = "" . $i;
Perl automatically converts numbers to strings, and strings to numbers, whenever required. The concatenation with the empty string is superfluous, it only indicates programmer intent.