| ページ一覧 | ブログ | twitter |  書式 | 書式(表) |

MyMemoWiki

差分

ナビゲーションに移動 検索に移動
423 バイト除去 、 2021年3月1日 (月) 14:31
$ swift subscript.swift
ABC
</pre>
 
==タプル==
<pre>
let prof : (String, Double, Int) = ("Yagi", 173.0, 49)
print("\(prof.0) \(prof.1) \(prof.2)")
 
let (name, tall, age) = prof
print("name is \(name) \(tall) cm \(age) yo")
 
let prof2 = (name:"Yagi",tall:173.0, age:49)
print("name is \(prof2.name) \(prof2.tall) cm \(prof2.age) yo")
</pre>
*結果
<pre>
Yagi 173.0 49
name is Yagi 173.0 cm 49 yo
name is Yagi 173.0 cm 49 yo
</pre>

案内メニュー