LoginSignup
0
0

More than 1 year has passed since last update.

Rubyの変数展開

Posted at

シングルクォーテーション('')は変数展開が行われない。

変数展開を行う理由は、自動で#to_sが働くから。
#to_sとは、文字列ではない値を文字列に変換するメソッド。

変数展開は、文字列連結と違い、数値 + 文字列の連結ができる。

0
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
0
0