join

func join<C : ExtensibleCollectionType, S : SequenceType where C == C>(_: C, elements: S)

Creates and returns a collection of type C that is the result of interposing a given separator between the elements of the sequence elements.

For example, this code excerpt writes "here be dragons" to the standard output:

println(join(" ", [ "here", "be", "dragons" ]))

Declaration

func join<C : ExtensibleCollectionType, S : SequenceType where C == C>(separator: C, elements: S) -> C