Hello ,how can i turn this list<string> to array ?

List<string> <0x600001556fd0> (
[0] sc5iqf,sc5iqg,sc5iqh,sc5iqi,sc5iqj,sc5iqk
)
You already invited:

Wiredu

Upvotes from: Osazuwa

 let list = game.screenShotsId.joined(separator: ",")
let data = list.components(separatedBy: ",")
for data in data {
self.images.append(data)
}

Kelly Sam

Upvotes from:

`sc5iqf,sc5iqg,sc5iqh,sc5iqi,sc5iqj,sc5iqk` this to array

Osazuwa

Upvotes from:

Are you perhaps meaning "how to turn a comma separated string to an array?". Because your list only has one element, a string.

If you wanna answer this question please Login or Register