Concatenate strings with the
s1 = "Hello" s2 = " " s3 = "World" puts s1 + s2 + s3 # => Hello World s = s1 + s2 + s3 puts s # => Hello World
Or with the
s = 'Hello' s << ' ' s << 'World' puts s # => Hello World
Note that the
<< operator modifies the object on the left hand side.
You also can multiply strings, e.g.
"wow" * 3 # => "wowwowwow"