3 ms·
You must be pretty happy with String then, if that's your biggest gripe :-) Do you really mean Iterable<Character> and not Iterable<Integer>. Because a Unicode
by needusername 12y ago
You must be pretty happy with String then, if that's your biggest gripe :-)
Do you really mean Iterable<Character> and not Iterable<Integer>. Because a Unicode code point can spawn two chars.
- TheLoneWolfling 12y agoPersonally, 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