If I have this code:
a = "hi" "pie"
puts a
It will print out hipie
. Does Ruby automatically combine these?
If I have this code:
a = "hi" "pie"
puts a
It will print out hipie
. Does Ruby automatically combine these?
Yes. From Literals: String
Adjacent string literals are automatically concatenated by the interpreter:
"con" "cat" "en" "at" "ion" #=> "concatenation" "This string contains " "no newlines." #=> "This string contains no newlines."