Scala Tutorialsを読む 6 String interpolation

http://scalatutorials.com/tour/interactive_tour_of_scala_string_interpolation.html

今日は、6 String interpolationです。 interpolationは内挿法とかがいいのかな?文字列内挿法? 文字列に式が書ける奴ですね。 interpolationはSwiftでもあったり、Nemerleでもあるぜと、アリスさんが言ってたりしましたが、Scalaにもあるということですな。

From Scala 2.10, string interpolation is supported. Scala2.10から、Stringインターポレーションがサポートされました。

For complex expressions add curly braces, e.g.

例のように複雑な式のために、カーリーブレースを加えます。

s"Two times three: ${2 * 3}"

See Also opens in new page 参照

  • String interpolation in Scala
  • What is this 'Tau' thing?

Tauって、2πのことなのかな?ようわからないけどいいや。

明日は、7 String formattingを見ます。 特に明日は難しくないな。