Concat enum of strings into one string

Andrey saasecondbox at yandex.ru
Tue Aug 14 13:42:04 UTC 2018


Hello,
I have a enum:

enum Type : string
{
     One = "Q1",
     Two = "W2",
     Three = "R3"
}

I want to concat it in compile-time:

enum result = doConcat!Type();

And get this result:

writeln(result); // output: "Q1 W2 R3"

Delimiter here is space symbol.
How do do it?


More information about the Digitalmars-d-learn mailing list