strings.Fields() Function in Golang is used to splits the given string around each instance of one or more consecutive white space characters, as defined by unicode.IsSpace, returning a slice of substrings of str or an empty slice if str contains only white space.
Syntax:func Fields(str string) string
Returns: A slice of substrings of str or an empty slice if str contains only white space.
[GeeksforGeeks is a computer science portal !] [I am a software developer, I love coding]
[I love to code all day.] [I am learning Go language]
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.