Logo

Programming-Idioms

History of Idiom 153 > diff from v1 to v2

Edit summary for version 2 by programming-idioms.org:
New Go implementation by user [programming-idioms.org]

Version 1

2016-10-27, 09:04:01

Version 2

2016-10-27, 09:06:18

Idiom #153 Concatenate string with integer

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

Idiom #153 Concatenate string with integer

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

Extra Keywords
int concat
Extra Keywords
int concat
Imports
import "fmt"
Code
t := fmt.Sprintf("%s%d", s, i)
Doc URL
https://golang.org/pkg/fmt/#Sprintf
Demo URL
https://play.golang.org/p/A5pbvrOrJP