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
Also in Swift:
- swift open url
- how to set return type swift
- enum from raw value swift
- set image width and height swiftui
- swift close app
- xcode cannot find uiimagepickercontrolleroriginalimage in scope
- how to show notification icon on tabbar item swift
- swiftui background color
- How do I check if a string contains another string in Swift
- UIFont.init bold
- swift how to add a completion block to a function
- swift switch
- dart capitalize first letter of each word
- swift ternary statement
- .next() enum swift
- set button programmatically swift
- IOS create UIAlertViewController programmatically
- swift uitextfield only numbers keyboard lock programmatically
- swift declare optional values
- swift list
- sheet swiftui
- swift writing to ios logs
- how to swift pie chart quartzcore framework
- Core Data Quickest way to delete all instances of an entity swift