Returns a new string by concatenating the elements of the sequence, adding the given separator between each element.
SDK
- Xcode 7.1+
Framework
- Swift Standard Library
Declaration
Available when Element conforms to String Protocol.
Parameters
separator
A string to insert between each of the elements in this sequence. The default separator is an empty string.
Return Value
A single, concatenated string.
Discussion
The following example shows how an array of strings can be joined to a single, comma-separated string: