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
iOS 14부터 달라진 앱에서 이메일 보내는 방법