3 ms·
Do you have an example of the behavior you're describing? The article offers a demonstration that seems to work as the author described: https://play.rust-lang
by sargas 10y ago
Do you have an example of the behavior you're describing? The article offers a demonstration that seems to work as the author described:
https://play.rust-lang.org/?gist=5d3174958c76718508f6ab4566084829&version=stable&backtrace=2 https://play.rust-lang.org/?gist=5d3174958c76718508f6ab45660...
But now I'm curious. Aren't the characters in the example above comprised of multiple Unicode code points?
- lokedhs 10y agoUnicode is more complicated than that. First of all, there is not a single definition of what the idea of a "single character" even is. It could be code points, composed characters, grapheme clusters, or something else. However, in practice there are very few situations where a programmer would ever need to make this distinction for arbitrary text. If you give me an example of where you feel that you need to split an arbitrary string by "character", I'm pretty sure I'll be able to counter that with an explanation as to why that is not the right thing to do.