I\'m looking for a better way to merge variables into a string, in Ruby.
For example if the string is something like:
\"The animal action<
animal
action<
This is called string interpolation, and you do it like this:
"The #{animal} #{action} the #{second_animal}"
Important: it will only work when string is inside double quotes (" ").
Example of code that will not work as you expect:
'The #{animal} #{action} the #{second_animal}'