Looking for ruby Answers? Try Ask4KnowledgeBase
Looking for ruby Keywords? Try Ask4Keywords

Ruby Language Joining Strings


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.

# => ""