Answers for "swift break string into array"

5

Split a String into an array in Swift

let fullName = "First Last"    
let fullNameArr = fullName.components(separatedBy: " ")
let firstName = fullNameArr[0] //First
let lastName = fullNameArr[1] //Last
Posted by: Guest on January-31-2020
0

string to array swift

let yourString = "Let's split this string"
let arrayValue = split(yourString) {$0 == " "}
Posted by: Guest on July-02-2021

Code answers related to "swift break string into array"

Code answers related to "Swift"

Browse Popular Code Answers by Language