3 ms·
Personally, I wish there was a GraphemeCluster class, with a way to coerce a String into an Iterable<GraphemeCluster>, Collection<GraphemeCluster>, etc. Because
by TheLoneWolfling 12y ago
Personally, I wish there was a GraphemeCluster class, with a way to coerce a String into an Iterable<GraphemeCluster>, Collection<GraphemeCluster>, etc. Because most of the time people don't want to iterate over code points - they want to iterate over user-perceived characters instead. It makes more sense that by default "école".reverse() (that's the two-code-point version of "é") would be "elocé" rather than "eloće".
But I've said a lot on the subject of strings already:
https://news.ycombinator.com/item?id=8198811 https://news.ycombinator.com/item?id=8198811
https://news.ycombinator.com/item?id=8066158 https://news.ycombinator.com/item?id=8066158
https://news.ycombinator.com/item?id=7606084 https://news.ycombinator.com/item?id=7606084
https://news.ycombinator.com/item?id=7574665 https://news.ycombinator.com/item?id=7574665
https://news.ycombinator.com/item?id=7075858 https://news.ycombinator.com/item?id=7075858