Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

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
Comment

PREVIOUS NEXT
Code Example
Swift :: swift + data to string 
Swift :: navigationview hide header swiftui 
Swift :: Detect if device is ipad or iphone swift 
Swift :: toggle in swift 
Swift :: swift change navigation bar color 
Swift :: find object in array by property swift 
Swift :: get device name swift 
Swift :: access dictionary with index swift 
Swift :: swift xcode debug cannot see code backtrace 
Swift :: swift get current time 
Swift :: change selection color uitableviewcell swift 
Swift :: swift temporary directory 
Swift :: swift substring 
Swift :: save codable in userdefaults ios swift 
Swift :: How to Programatically Exit Flutter App 
Swift :: swiftui steppers 
Swift :: swift do while 
Swift :: and in swif 
Swift :: porsche 
Swift :: swift hex color 
Swift :: add to beginning of array swift 
Swift :: transform string to url swift 
Swift :: change ui button swift 
Swift :: convert uiimage to swiftui image 
Swift :: swift array index of where 
Swift :: Swift if..else if 
Swift :: swft view 
Swift :: swift comment 
Swift :: Swift guard Vs if Statement 
Swift :: swift 5 progress bar height 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =