许多编程语言支持类似以下的构造(以Python为例):
在Crystal中,惯用的做法是什么?
>>> ["One", "two", "three"].join(" and ")
"One and two and three"
在Crystal中,惯用的做法是什么?
>>> ["One", "two", "three"].join(" and ")
"One and two and three"
Enumerable
而不是Array
的一部分,唉。 - obskyr'和'.join(["One", "two", "three"])
,但是嘿。 - obskyr