4
4
4utka_pyan2017-04-15 21:29:33
go
4utka_pyan, 2017-04-15 21:29:33

What's wrong with counting length?

package main

import "fmt"
import "unicode/utf8"

func main() {
    fmt.Println(len("Hello World"))
    fmt.Println(utf8.RuneLen('слово'))
}

# command-line-arguments
.\len.go:8: missing '
.\len.go:8: syntax error: unexpected catchy, expecting comma or )

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
om1058, 2017-04-15
@4utka_pyan

package main

import "fmt"
import "unicode/utf8"

func main() {
    fmt.Println(len("слово"))
    fmt.Println(utf8.RuneCountInString("слово"))
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question