「Ruby入門」文字列の式展開((#{式))のサンプル

サンプルコード
a = 9; b = 2
puts “Result is #{ a * b }"

strN= “User007"
puts “Test Data is #{strN}"

結果
Result is 18
Test Data is User007

Ruby

Posted by arkgame