Logo

Programming-Idioms

  • C++
  • PHP
  • Ada
  • Ruby

Idiom #153 Concatenate string with integer

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

t = "#{s}#{i}"
t = s + i.to_s
#include <string>
auto t = s + std::to_string (i);
$t = $s . $i;
t : String := s & Integer'Image (i);
(def t (str s i))

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