I have an array of Strings in my Swift app. I want to display them in a label, each of them separated by ,. I tried this:
for hashtag in placeHashtags {
text = text + "\(hashtag), "
}
if (placeHashtags.count > 0){
let text1 = text.remove(at: text.index(before: text.endIndex-1))
text = text1.description
}
(the 2nd if is to remove the last comma), but then I do not see anything in my label.
How can I fix it?
text.remove(at:)returns the removed character, not the modified string.