swift学习之路(十)字典

来源:互联网 发布:天庭淘宝城宋小刀txt 编辑:程序博客网 时间:2024/05/17 07:36

import Foundation


var sample : Dictionary<String,Int> = ["key1":1,"key2":2,"key3":3]


sample.updateValue(22, forKey:"key2")


print(sample["key2"])


sample.removeValueForKey("key2")


for values insample.values{

print(values)

}


0 0
原创粉丝点击