Build all combinations of strings

Andrej Mitrovic andrej.mitrovich at gmail.com
Mon Jun 11 10:41:58 PDT 2012


Is there a Phobos function to turn this:

string[] words = "foo bar doo".split();

into:

string[] res = ["foo bar doo",
                "foo doo bar",
                "bar foo doo",
                "bar doo foo",
                "doo foo bar",
                "doo bar foo"];

So basically all combinations of some number of strings into a string
array. I suppose there's some generic way to do this too.


More information about the Digitalmars-d-learn mailing list