Logo

Programming-Idioms

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

Idiom #153 Concatenate string with integer

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

import "strconv"
t := s + strconv.Itoa(i)

This is faster than fmt.Sprintf.
import "fmt"
t := fmt.Sprintf("%s%d", s, i)
t : String := s & Integer'Image (i);

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