To Walter, about char[] initialization by FF

Walter Bright newshound at digitalmars.com
Mon Jul 31 09:56:15 PDT 2006


Oskar Linde wrote:
> It is easy to implement your own character count though:
> 
> size_t count(char[] arr) {
>     size_t c = 0;
>     foreach(dchar c;arr)
>         c++;
>     return c;
> }
> 
> assert("тест".count() == 4);

std.utf.toUCSindex(s, s.length) will also give the character count.



More information about the Digitalmars-d mailing list