Logo

Programming-Idioms

Create the string representation s (in radix 10) of the integer value i.
New implementation

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating material.

Please try to avoid dependencies to third-party libraries and frameworks.

Other implementations
S : String := Integer'Image (I);
#include <stdlib.h>
char s[0x1000]={};
itoa(i,s,10);
(let [s (str i)])
#include <string>
auto s = std::to_string(i);
string s = i.ToString()
import std.conv;
string s = i.to!string;
var s = "$i";
s = to_string(i)
s = "#{i}"
s = Integer.to_string(i)
S = integer_to_list(I).
  write (unit=s,fmt=*) i
import "strconv"
s := strconv.Itoa(i)
import "strconv"
s := strconv.FormatInt(i, 10)
import "fmt"
s := fmt.Sprintf("%d", i)
def s = "$i".toString()
let s = show i
var s = i + "";
var s = i.toString();
String s=((Integer)i).toString();
String s = "%d".formatted(i);
String s = Integer.toString(i);
String s = String.valueOf(i);
String s = "" + i;
String s = "";
while (i != 0) {
    s = i % 10 + s;
    i = i / 10;
}
val s = i.toString()
(setf s (princ-to-string i))
s = tostring(i)
@import Foundation;
NSString *s=@(i).description;
$s = (string)$i;
$s = "{$i}";
$s = "$i";
$s = strval($i);
Str(i,s);
uses SysUtils;
var
  _s: String;
  _i: Integer;
begin
  _s := IntToStr(_i);
end.
my $s = "" . $i;
$s = "$i";
s = str(i)
s = i.to_s
let s = i.to_string();
let s = format!("{}", i);
val s = i.toString
(define s (number->string i))
s := i asString.
Dim myInt As Integer = 12345
Console.WriteLine(myInt.ToString)