Swift-数组和字典的定义

在Swift3.0中,定义数组和字典常用的三种方法对应列出:

var student = [String]()
var student1 = [String:String]()

var stud:[String] = ["xiaobao"]
var stud1:[String:String] = ["dudf" : "sfdfsd"]

var dd = Array<String>()
var dic = Dictionary<String, String>()
    原文作者:sz_vcp2007
    原文地址: https://blog.csdn.net/sz_vcp2007/article/details/54588180
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞