Module ddash.algorithm.concat
Create a new range concatenating input range/value with any additional ranges and/or values.
Example
import std .range: iota;
// Concat stuff
assert([1, 2, 3] .concat(4, [5], [6, 7], 8) .equal(1 .iota(9)));
// Concat single element
assert([1] .concat(2) .equal([1, 2]));
// Implicitly convertible doubles with ints
assert([1.0] .concat([2, 3]) .equal([1.0, 2.0, 3.0]));
// Concat nothing to single value
assert(1 .concat() .equal([1]));
// Concat nothing to range
assert([1] .concat() .equal([1]));
// Concat values to another value
assert(1 .concat(2, 3) .equal([1, 2, 3]));
// Concat ranges or values to another value
assert(1 .concat(2, [3, 4]) .equal([1, 2, 3, 4]));
// Concat strings
assert("yo" .concat("dles") .equal("yodles"));
// Concat stuff to string
assert("abc" .concat(1, 2, 3) .equal("abc123"));
Functions
Name | Description |
---|---|
concat(values)
|
Concats everything together using best effort. |