Inconsitency

Dmitry Olshansky dmitry.olsh at gmail.com
Sun Oct 13 06:50:54 PDT 2013


13-Oct-2013 17:25, nickles пишет:
> Ok, if my understandig is wrong, how do YOU measure the length of a string?
> Do you always use count(), or is there an alternative?
>
>
It's all there:
http://www.unicode.org/glossary/
http://www.unicode.org/versions/Unicode6.3.0/

I measure string length in code units (as defined in the above 
standard). This bears no easy relation to the number of visible 
characters but I don't mind it.

Measuring number of visible characters isn't trivial but can be done by 
counting number of graphemes. For simple alphabets counting code points 
will do the trick as well (what count does).

-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list