Ruby 3 · Basics

Print and interpolate

Print a line, inserting expressions with #{}. Double quotes interpolate; single quotes don't.

name = "Ada"
puts "Hello, #{name}! 2 + 2 = #{2 + 2}"

Official Ruby 3 documentation

More basics commands

All basics commands · Ruby 3 cheatsheet

Was this page helpful?