Jason Zhou
Jason Zhou

Reputation: 463

Joining strings in golang

why are the output of those codes different?

fmt.Println(Join([]string{"name=xxx", string(127)}, "&"))

output name=xxx&

fmt.Println(Join([]string{"name=xxx", "127"}, "&"))

output name=xxx&127

Any help!

Upvotes: 1

Views: 580

Answers (1)

Jiang YD
Jiang YD

Reputation: 3311

string(127) means the character whose code is 127, it is not printable. use strconv

Upvotes: 5

Related Questions