date[2018-12-30]
// Package words provides support for counting words.
package words
import "strings"
// CountWords counts the number of words in the specified
// string and returns the count.
func CountWords(text string) (count int) {
count = len(strings.Fields(text))
return
}
func CountWords2(text string) int {
return len(strings.Fields(text))
}
网友评论