mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 00:11:36 +08:00
Update word_letter_count.go
This commit is contained in:
@@ -31,7 +31,6 @@ func main() {
|
||||
|
||||
func Counters(input string) {
|
||||
nrchars += len(input) - 2 // -2 for \r\n
|
||||
// count number of spaces, nr of words is +1
|
||||
nrwords += len(strings.Split(strings.Trim(input, " \n")," "))
|
||||
nrwords += len(strings.Fields(input))
|
||||
nrlines++
|
||||
}
|
||||
|
Reference in New Issue
Block a user