On Saturday, July 23, 2016 at 11:04:44 PM UTC+8, Matt Silverlock wrote: > > https://blog.golang.org/strings > > utf8.RuneCountInString is about as close as you will get. Do you have an > example string that is not meeting expectations? >
I forgot in which article (an official one) that says character != rune. And it provides an example, character é is made up of two runes, three bytes. > > On Saturday, July 23, 2016 at 7:52:29 AM UTC-7, T L wrote: >> >> len(str) will get the count of bytes. >> >> utf8.RuneCountInString(str) will get the count of runes. >> >> but how to get the count of characters? >> > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.