SWIFT入门 Dictionary
发布日期:2021-06-29 21:14:30 浏览次数:4 分类:技术文章

本文共 600 字,大约阅读时间需要 2 分钟。

var menu:[String] = [“1”,“2”,“3”]

print(menu.count)

print(menu[0])

menu+=[“4”,“5”]

menu+=[“6”,“7”]

print(menu.count)

print(menu[1…3])

let constantName=1

print(constantName)

let decimalInteger=17

let binaryInteger=0b10001

let octalInteger=0o21

let hexadecimalInteger=0x11

print(decimalInteger)

print(binaryInteger)

print(octalInteger)

print(hexadecimalInteger)

var company: = [

“APPL”: “Apple Inc”,
“GOOG” : “Google Inc”,
“AMZN” : “Amazon.com Inc”,
“FB” : “Facebook Inc”
]

print(company[“APPL”]!)//if this value may become empty, and the ! may help solve the optional one back to the ordinary variable

转载地址:https://dequn.blog.csdn.net/article/details/109823974 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:SWIFT SET
下一篇:C++2 dimension vector

发表评论

最新留言

路过,博主的博客真漂亮。。
[***.116.15.85]2024年04月20日 09时05分09秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

推荐文章