To concatenate two strings in Ruby, you can use the `+` operator or the `<<` operator.
In this example,
str1
and str2
with values "Hello"
and "World"
respectively.str2
to str1
using the `+` operator and store the result in a variable named result
.result
to the console.str1 = 'Hello'
str2 = 'World'
result = str1 + str2
puts result
HelloWorld
In this tutorial, we learned How to Concatenate Two Strings in Ruby language with well detailed examples.