go string to int array with space separator code example
Example: go string to int array with space separator
func strToIntArr(s string) []int {
strs := strings.Split(s, " ")
res := make([]int, len(strs))
for i := range res {
res[i], _ = strconv.Atoi(strs[i])
}
return res
}