I searched on # in this forum before asking this question. One post
said that line numbers were added in front of the code so that it can be
discussed. I did not see the code. Other search matches lead to more
complicated questions.
My question:
puts “My statement: #{statement}” please explain what the # sign and
the parameter in the {} are doing.
I have a few more syntax questions but I will ask them in separate
topics.
That’s the syntax for Interpolation in a double-quoted string. Anything
between the braces will be evaluated and inserted into the string.
Joel,
It seems like a nice way to do string concatenation. I would have never
thought of this idea. I cannot wait to get further into ruby to use
this.
Thanks,
Kevin
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.