Answers for "find last string in list swift"

0

how to get last element of an array in swifg

let myArray = ["Hello!", "World!"]
let capacity = myArray.count
let lastElement = myArray[capacity-1]
print(lastElement)
Posted by: Guest on October-26-2020
0

get last element of array swift

let array = ["A", "B", "C", 1, 2, 3]
let size = array.count
last_element = array[size-1]
print(last_element)
Posted by: Guest on September-07-2020

Code answers related to "find last string in list swift"

Code answers related to "Swift"

Browse Popular Code Answers by Language