Answer the question
In order to leave comments, you need to log in
How to determine if a string contains unicode?
This is necessary in order to calculate the length of the string.
Or it makes sense to connect in any case and just do this option, the answer gives the correct one, regardless of what characters are inside. import "unicode/utf8"
fmt.Println(utf8.RuneCountInString("жжvv"))
Answer the question
In order to leave comments, you need to log in
Yes.
Well, you can stillutf8.RuneCountInString("жжvv")
runes:=0
for range "жжvv"{
runes++
}
fmt.Println(runes)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question