For loop with separator

berni someone at somewhere.com
Sat Jul 6 11:48:42 UTC 2019


On Thursday, 4 July 2019 at 17:00:33 UTC, Q. Schroll wrote:
> The prime example is printing the comma when printing a list: 
> There is one between any two elements, but neither is one at 
> front or behind the last one.

If it is just for printing commas in between, you can use 
range.join(", ")

https://dlang.org/phobos/std_array.html#.join




More information about the Digitalmars-d-learn mailing list