Answers for "go last element of array"

Go
-1

golang get last element of slice

sl = sl[:len(sl)-1]
Posted by: Guest on November-12-2020
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

Browse Popular Code Answers by Language