Logo

Programming-Idioms

  • JS
  • Lua

Idiom #153 Concatenate string with integer

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

t = s .. i

the ".." operator concatenates strings and automatically converts integers to strings
let t = `${s}${i}`

Using template literals
let t = s + i;
t : String := s & Integer'Image (i);

New implementation...
< >
programming-idioms.org