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

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
swift array split by value how to split an array ios swift swift split array by value swift split string by string swift split string to array how to split string into array in swift swift split string into string array swift split string number into array split array to array in swift split string to array swift swift separate string to array string split string with string swift swift split string by dot to array swift split array into strings swift separate string into array split data by string swift swift split array at index split the string to array in swift 5 swift split string at index split the array swift swift split string into array split array in swift split array into string in swift array split swift swift string split to string array split array to string swift how to split array in swift swift how to split with string swift how to split by string separator string in array swift swift string split by string how to split string by character swift how to cut string to two parts in swift how to split array swift 'Separated By Characters In Set' on swift 5 seperate text ios swift swift split array by property swift auto seperate sentence in array split function swift array split after dot swift swift split string by period convert string to array separated by charcters swift 5 separate string to array swift string separated by comma or space in array swift 5 how to spilt in swift swift divide string by comma split and array in swift swift string split how to use splitter in swift swift split a string swift string split by word swift split string aT SUBSTING split string on particular string swift split list in swift swift convert array substring to string swift split by string ways to split string swift swift divide string by space swift split string by character split textfied swift swift split separator how to split the string in swift swift split string by substring using split to extract individual values in swift split() in swift splits swift swift split character set convert array swift split split string into array swift how to split a string into words in swift slip string swift 2 swift 5 split string swift split string into array of strings swift String spilte how to split a string swift swift break a string in 2 swift 5 split string on comma into array split in swift spkit return type in swift to int array string split in swift output data type swift split string by words separate string swift split string in array swift swift split string by char how to split a string into individual characters swift swift split string with string separator swift string split words swift separate string by comma how to separate a string in swift components separated by string swift how to read string using seprator swift separate string by comma swift swift split words using space string split swift how to split string in array swift how to split string in swift how to parse a string in swift split by character in swift .splut swift .split swift seperating strings swift split input string swift swift parse a string break a string value into different parts in swift split string by character swift component separated by pi string in swift 4 component separated by string in swift 4 swift string split by character split string by string swift split a string swift split string into array in swift swift string to array split swift split by character string split in swift how split the strings in swift split function in swift .split() in swift 5 .split() in swift5 .split() in swift split string swift split data from string in swift how to particular data split in swift how to split data one by one from class in swift how to split data one by one from\ class in swift how to split data one by one from string class in swift swift split string by comma swift string split swift string to array of words swift split string into array by spaces substrign when colon character swift how to split the characters in swift split 16 text in swift split text swift how to expload charachter of the string in swift using split and components to break string Swift separator string by , swift how to break strings swift swift 3 split string break string in swift split where space swift how to break a string into an array swift swift split string split string in swift swift 4 split string by character how to split a string into individual characters swift array how to split a string in swift components separated by swift whitespace split swift how to split a string by spaces in swift Split a String into an array in Swift? ios switf split string Split a String into an array in Swift
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source