我想通过分隔符“/”扩展一串切片。
例如,扩展以下切片
s := []string{"5/3","9","5/4/1","6"}
应该产生单独的切片:
["5","9","5","6"] ["5","9","4","6"] ["5","9","1","6"]
["3","9","5","6"] ["3","9","4","6"] ["3","9","1","6"]
我几乎被困在这里
var c [][]string{}
s := []string{"5/3","9","5/4/1","6"}
for _, v := range s {
combos := strings.Split(v, "/")
for _, combo := range combos {
}
}
四季花海
相关分类