Using joined()
method, we can merge an array of strings to a single string. We can add a separator too.
1
2
3
4
let names = ["Brian", "Nick", "John", "David"]
let list = names.joined(separator: ", ")
print(list)
// "Brian, Nick, John, David"
Using joined()
method, we can merge an array of strings to a single string. We can add a separator too.
1
2
3
4
let names = ["Brian", "Nick", "John", "David"]
let list = names.joined(separator: ", ")
print(list)
// "Brian, Nick, John, David"
새 버전의 콘텐츠를 사용할 수 있습니다.