mirror of
https://github.com/dlang/phobos.git
synced 2025-04-29 14:40:30 +03:00
Moved join from std.string to std.array, plus a few cosmetic changes
This commit is contained in:
parent
a0ecf2a10e
commit
cf33c1999a
4 changed files with 175 additions and 191 deletions
|
@ -1853,10 +1853,18 @@ unittest
|
|||
|
||||
// joiner
|
||||
/**
|
||||
Lazily joins a range of ranges with a separator. The range of ranges
|
||||
Lazily joins a range of ranges with a separator. The separator itself
|
||||
is a range.
|
||||
|
||||
Example:
|
||||
----
|
||||
assert(equal(joiner([""], "xyz"), ""));
|
||||
assert(equal(joiner(["", ""], "xyz"), "xyz"));
|
||||
assert(equal(joiner(["", "abc"], "xyz"), "xyzabc"));
|
||||
assert(equal(joiner(["abc", ""], "xyz"), "abcxyz"));
|
||||
assert(equal(joiner(["abc", "def"], "xyz"), "abcxyzdef"));
|
||||
assert(equal(joiner(["Mary", "has", "a", "little", "lamb"], "..."),
|
||||
"Mary...has...a...little...lamb"));
|
||||
----
|
||||
*/
|
||||
auto joiner(Range, Separator)(Range r, Separator sep)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue