Scala Tutorialsを読む 7 String formatting

今日は、 http://scalatutorials.com/tour/interactive_tour_of_scala_string_formatting.html を読みます。

書くの忘れてたのだけど、C言語のprintf的な物がScalaにもあるよっていう。

printf works as well...

printf は同じように動きます...

瞬殺すぎる。

printf("Now you have %.16f problems.", Math.nextAfter(2.0, 3))  

こんな感じで書けるんですね。

See Also opens in new page

新しいページを開いて参照