Ruby Language Strings Joining Strings

30% OFF - 9th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY9


Array#join joins an Array into a String, based on a delimiter:

["alpha", "beta"].join(",")
# => "alpha,beta"

The delimiter is optional, and defaults to an empty String.

["alpha", "beta"].join
# => "alphabeta"

An empty Array results in an empty String, no matter which delimiter is used.

# => ""

Got any Ruby Language Question?