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.

String t = s + i;
import std.format : format;
string t = "%s%d".format(s, i);
import std.conv : to;
string t = s ~ to!string(i);
import "fmt"
t := fmt.Sprintf("%s%d", s, i)
t = s ++ show i
  t := s + IntToStr(i);
t = '{}{}'.format(s,i)
t = s + i.to_s
let t = format!("{}{}", s, i);

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

Idiom created by

Related idioms