BidirectionalCollection
protocol BidirectionalCollection : Collection
-
Returns elements of this collection joined using a separator between each two elements. Last separator can be a different one.
Note
Useful to create strings like:
One, two, three and four
.Declaration
Swift
public func joined(separator: String, lastElementSeparator: String) -> String
Parameters
separator
Separator to be used between each two elements but the last pair.
lastElementSeparator
Separator to be used between last two elements.
Return Value
String with this collection’s elements joined.