Tags
swift
Asked 4 years ago
13 Jan 2020
Views 1162
iptracker

iptracker posted

how to explode string in to array in swift

how to explode string in to array in swift
angeo

angeo
answered Nov 30 '-1 00:00


you can use separatedBy in string components

let str = "Hello arrayoverflow"
let components = str.components(separatedBy: "  ")
jabber

jabber
answered Nov 30 '-1 00:00

use split with separator . will work same


let are= "i am coder"
let areitems= line.split(separator: " ")
Post Answer