Join in Go

Posted by GoDoc
Public (Editable by Users)

Join concatenates the elements of a to create a single string. The separator string sep is placed between elements in the resulting string.

Go
Edit
package main

import (
	"fmt"
	"strings"
)

func main() {
	s := []string{"foo", "bar", "baz"}
	fmt.Println(strings.Join(s, ", "))
}