reduce string ranges

bearophile bearophileHUGS at lycos.com
Tue Jun 3 18:22:51 PDT 2008


Brian Myers:
> I'd like to be able to use the reduce template on a range of strings. The following:
> int main(char[][] args)
> {
>     string[] tstarr = ["one", "two", "three"];
>     writefln(reduce!("a ~ b")("", tstarr));
> }

Don't do that, probably it's a slow way to join an array of strings.
In the std.string module you can use the join("") function, or you can use joinArr() function from the d.string module of mine.
(I have like a dejavu, isn't this discussion happened already?)

Bye,
bearophile



More information about the Digitalmars-d mailing list