Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var array = ["1","2","3"]
- print(array[0])
- //1
- array.remove(at: 0)
- print(array[0])
- //2
- var dict = [
- "1":"One",
- "2":"Two",
- "3":"Three"
- ]
- if let value = dict["1"]{
- print(value)
- //One
- }
- if let index = dict.index(forKey:"1"){
- dict.remove(at: index)
- print(dict)
- //["2":"Two","3":"Three"]
- }
Add Comment
Please, Sign In to add comment