3 ms·
> Using len() with Strings, and UTF-8 Gotchas Try utf8.RuneCountInString().
by radlad 1y ago
> Using len() with Strings, and UTF-8 Gotchas
Try utf8.RuneCountInString().
- gethly 1y agoProblem with this is that it requires the whole string to be iterated over, byte by byte, or rune by rune, whereas len() does no such thing as the length is stored in the underlying type.