Split A String Into An Array In Swift

[Solved] Split A String Into An Array In Swift | Swift - Code Explorer | yomemimo.com
Question : Split a String into an array in Swift

Answered by : mobile-star

let fullName = "First Last"
let fullNameArr = fullName.components(separatedBy: " ")
let firstName = fullNameArr[0] //First
let lastName = fullNameArr[1] //Last

Source : | Last Update : Fri, 07 Feb 20

Answers related to Split a String into an array in Swift

Code Explorer Popular Question For Swift