Comment on The Absolute Minimum Every Software Developer Must Know About Unicode in 2023 (Still No Excuses!)

<- View Parent
Black616Angel@feddit.de ⁨8⁩ ⁨months⁩ ago

And rust also has the “🤦”.chars().count() which returns 1.

I would rather argue that rust should not have a simple len function for strings, but since str is only a byte slice it works that way.

Also also the len function clearly states:

This length is in bytes, not chars or graphemes. In other words, it might not be what a human considers the length of the string.

source
Sort:hotnewtop