Go Join()

1 개요[ | ]

Go Join()
Go 문자열 배열을 문자열로 변환
package main

import (
    "fmt"
    "strings"
)

func main() {
    fruits := []string{"apple", "banana", "mango"}
    fmt.Println(strings.Join(fruits," ")) // apple banana mango
}
package main

import (
    "fmt"
    "strings"
)

func main() {
    fruits := []string{"apple", "banana", "mango"}
    var s string
    s = strings.Join(fruits," ")
    fmt.Println(s) // apple banana mango
}

2 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}