An input range of input ranges
An input range, or a single element, to join the ranges on
An array of elements
assert(join(["hello", "silly", "world"], " ") == "hello silly world"); assert(join(["hello", "silly", "world"]) == "hellosillyworld"); assert(join([[1, 2, 3], [4, 5]], [72, 73]) == [1, 2, 3, 72, 73, 4, 5]); assert(join([[1, 2, 3], [4, 5]]) == [1, 2, 3, 4, 5]); const string[] arr = ["apple", "banana"]; assert(arr.join(",") == "apple,banana"); assert(arr.join() == "applebanana");
For a lazy version, see std.algorithm.iteration.joiner
Eagerly concatenates all of the ranges in ror together (with the GC) into one array using sep as the separator if present.