Random string samples & unicode

bearophile bearophileHUGS at lycos.com
Sat Sep 11 11:24:02 PDT 2010


>     foreach (g; group(input)) {
>         string s = to!string(g._1);
>         s ~= g._0; // string ~ dchar wrong, string ~= dchar good
>         result ~= s;
>     }

Shorter:

    foreach (g; group(input))
        result ~= text(g._1, g._0);

bearophile


More information about the Digitalmars-d mailing list