How to split a string on white-space?

The Fields function breaks a string around each instance of one or more consecutive white space characters into an Array.


package main
import (
func main() {
  testString := "Australia is a country and continent surrounded by the Indian and Pacific oceans."
  testArray := strings.Fields(testString)  
  for _, v := range testArray {    
Most Helpful This Week