[Issue 11507] Associative Array Documentation

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Nov 13 10:19:42 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=11507


Chuck Allison <chuck at freshsources.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |chuck at freshsources.com


--- Comment #2 from Chuck Allison <chuck at freshsources.com> 2013-11-13 10:19:40 PST ---
Is this what you had in mind?

    string[] words = (cast(string)(read(filename))).split();
    int[string] counts;
    foreach (word; words)
        ++counts[word];
    foreach (w; sort(counts.keys))
        writefln("%s: %d", w, counts[w]);

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list