Answer the question
In order to leave comments, you need to log in
Does Ruby have double interpolation?
Good afternoon. Does Ruby have double interpolation when typing?
p = "my param"
s = $stdin.gets.strip! # #{p}
puts "Hi #{s} hi!" # Я хочу "Hi my param hi!"
Answer the question
In order to leave comments, you need to log in
That won't work. Interpolation is just syntactic sugar. You need to run your input through eval.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question