SWIFT入门 Dictionary
生活随笔
收集整理的這篇文章主要介紹了
SWIFT入门 Dictionary
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
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
總結
以上是生活随笔為你收集整理的SWIFT入门 Dictionary的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C++2 dimension vecto
- 下一篇: SWIFT SET