Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

swift remove from array

var elements = ["String", "String2", "String3"];
let element = elements.remove(at: 1) // Removes and returns the element at index 1
let first = elements.removeFirst() // Removes and returns the first element
let last = elements.removeLast() // Removes and returns the last element
elements.removeAll() // Removes all elements
 
PREVIOUS NEXT
Tagged: #swift #remove #array
ADD COMMENT
Topic
Name
9+9 =