Re:Go is still not good
by roncesvalles on Friday August 22, 2025 @08:31AM
(#44983751)
I've always thought the point of the string type was for indexing. One index of a string is always one character, but characters are sometimes composed of multiple bytes.
[ Parent
| on HN ]
Re:Go is still not good
by crazygringo on Friday August 22, 2025 @09:08AM
(#44984214)
Yup. But to be clear, in Unicode a string will index code points, not characters. E.g. a single emoji can be made of multiple code points, as well as certain characters in certain languages. The Unicode name for a character like this is a "grapheme", and grapheme splitting is so complicated it generally belongs in a dedicated Unicode library, not a general-purpose string object.