Go 콤마 구분 리스트를 문자열 배열로 변환

1 개요[ | ]

Go 콤마 구분 리스트를 문자열 배열로 변환
package main

import (
	"fmt"
	"strings"
)

func main() {
	input := "apple,banana,cherry,grape,kiwi"
	words := strings.Split(input, ",")
	fmt.Println(words) // [apple banana cherry grape kiwi]
}

2 같이 보기[ | ]

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