美文网首页
我的swift 学习过程

我的swift 学习过程

作者: Kloar | 来源:发表于2016-01-19 13:26 被阅读25次

    import Foundationprint("Hello, World!")let emptyArray1 = []let empryArray2 = []var shoppingList = ["1","2","3","4","5"]print(shoppingList.count)print(shoppingList[1])shoppingList[1] = "bottle of water"print(shoppingList[1])let emptyDic = [:]let emptyDic1 = Dictionary()

    var occupations = [

    "My":"I",

    "U":"you"

    ]

    print(occupations["My"])

    occupations["LL"] = "KKK"

    print("the occupation count is" + String (occupations.count) )

    var shoppIng = ["小米","大米","玉米","糯米"]

    shoppIng.append("红米")

    print(shoppIng)

    shoppIng.insert("英语", atIndex: 2)

    print(shoppIng)

    shoppIng += ["白菜","西瓜"]

    //shoppIng += "白菜"

    print(shoppIng)

    print(shoppIng.isEmpty)

    print(shoppIng.count)

    print(shoppIng.capacity)

    相关文章

      网友评论

          本文标题:我的swift 学习过程

          本文链接:https://www.haomeiwen.com/subject/utnkkttx.html