3

Many languages support constructs like the following (Python, in this case):

>>> ["One", "two", "three"].join(" and ")
"One and two and three"

In Crystal, what is the idiomatic way to do this?

obskyr
  • 1,380
  • 1
  • 9
  • 25

1 Answers1

3

Use #join, which Array inherits from Enumerable. The example in the question works just as well in Crystal.

obskyr
  • 1,380
  • 1
  • 9
  • 25