Shovel operation in Ruby

Grace Do - Sep 6 - - Dev Community

An alternative way for string concatenation.

str1 = "This is a new string"
str2 = ". This is a new sentence."
result = str1 << str2
puts result
Enter fullscreen mode Exit fullscreen mode

Output:

This is a new string. This is a new sentence.
Enter fullscreen mode Exit fullscreen mode
. . . . .
Terabox Video Player