Answers for "golang remove space and split by comma"

Go
1

golang split spaces

someString := "one    two   three four "

words := strings.Fields(someString)

fmt.Println(words, len(words)) // [one two three four] 4
Posted by: Guest on August-13-2020

Code answers related to "golang remove space and split by comma"

Browse Popular Code Answers by Language