MCPcopy Create free account
hub / github.com/algolia/cli / StringToSlice

Function StringToSlice

pkg/utils/utils.go:70–72  ·  view source on GitHub ↗

Convert comma separated string values to slice

(str string)

Source from the content-addressed store, hash-verified

68
69// Convert comma separated string values to slice
70func StringToSlice(str string) []string {
71 return strings.Split(strings.ReplaceAll(str, " ", ""), ",")
72}
73
74// Convert slice of string to comma separated string
75func SliceToString(str []string) string {

Callers 3

runStringSliceCompletionFunction · 0.92
WriteAnswerMethod · 0.92
TestStringToSliceFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestStringToSliceFunction · 0.68