-3

I'm a beginner in Golang and I want to split a multiline text terminated by the EOF indicator, and I want to do it by the space and the presence of new lines ( since the user is gonna press "enter" a lot ).

Any idea of how?

1 Answers1

4

Use strings.Fields

words := strings.Fields(someString)

See example in The Go Playground