Skip to content

How to Join an Array of Strings

1 min read

Using joined() method, we can merge an array of strings to a single string. We can add a separator too.

let names = ["Brian", "Nick", "John", "David"]
let list = names.joined(separator: ", ")
print(list)
// "Brian, Nick, John, David"

Share this post on:

Previous Post
Higher Order Functions: Filter, Map, Reduce
Next Post
How to send emails from iOS 14