This language bar is your friend. Select your favorite languages!

Idiom #153 Concatenate string with integer

Create string t as the concatenation of string s and integer i.

let t = format!("{}{}", s, i);
#include <string>
auto t = s + std::to_string (i);
import std.conv : to;
string t = s ~ to!string(i);
import std.format : format;
string t = "%s%d".format(s, i);
import "fmt"
t := fmt.Sprintf("%s%d", s, i)
t = s ++ show i
String t = s + i;
$t = $s . $i;
  t := s + IntToStr(i);
uses Sysutils;
t := s + i.ToString;
t = '{}{}'.format(s,i)
t = s + i.to_s

Do you know the best way to do this in your language ?
New implementation...

Idiom created by

Related idioms