How to remove element from array at specific index in Swift

1 Answer

0 votes
var arr = ["swift", "c#", "c", "java", "python", "c++"]

print(arr)

arr.remove(at: 3)
print(arr)

arr.remove(at: 0)
print(arr)


  
   
/*
run:

["swift", "c#", "c", "java", "python", "c++"]
["swift", "c#", "c", "python", "c++"]
["c#", "c", "python", "c++"]
  
*/

 



answered Sep 2, 2020 by avibootz
...