syntax/adjacent_string_literals.rb
tests/_examples/syntax/adjacent_string_literals.rb in the metorex repository.
# String literals written next to each other are one string, with any
# interpolation in them kept.
count = 3
p("a" "b")
p("a" "#{count}")
p("#{count}" "b", count)
p("a" "#{count}" 'c', count)
p('x' "#{count * 2}" "y" "#{count}")
long = "first part, " \
"second part #{count}"
p(long)
Output:
"ab"
"a3"
"3b"
3
"a3c"
3
"x6y3"
"first part, second part 3"