Yes. I would:
- Split the string into its “fields,” as Go calls them, with the
strings.Fields
function. - Then use
strconv.Atoi
to convert each string field into an integer (assuming the integers are base10 and can fit into anint
):
Yes. I would:
strings.Fields
function.strconv.Atoi
to convert each string field into an integer (assuming the integers are base10 and can fit into an int
):