LoginSignup
2
0

More than 3 years have passed since last update.

【Swift】式展開

Posted at

式展開

Swiftでの式展開の方法を紹介します。
バックスラッシュと小カッコで式展開が可能です。また、コメントアウトもかけます。

//式展開
var name = "Tanaka"
print("Hello \(name))" ///Hello Tanaka

//コメントアウト
var food = "lemon"
print("\(food  /* コメントも書ける */) is fruits") //lemon is fruits
2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0