GoStringstrings.Join

Concatenates the elements of elems to create a single string separated by sep.

문법

strings.Join(elems []string, sep string) string

예제

아래 값을 입력하면 예제에 즉시 반영됩니다.

words
string
fmt
Println
strings
Hello
World
Go
words := []string{"Hello", "World", "Go"}
fmt.Println(strings.Join(words, " ")) // Hello World Go