# CollectionExpression join

**URL:** <https://discuss.hail.is/t/collectionexpression-join/1562>\
**Category:** Feature Requests\
**Created:** [July 31, 2020, 1:06am UTC](https://discuss.hail.is/t/collectionexpression-join/1562 "2020-07-31T01:06:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nlw](https://avatars.discourse-cdn.com/v4/letter/n/dec6dc/32.png) [@nlw](https://discuss.hail.is/u/nlw)\
**Post date:** [July 31, 2020, 1:06am UTC](https://discuss.hail.is/t/collectionexpression-join/1562/1 "2020-07-31T01:06:56Z")

</div>

Would love if there were a CollectionExpression function to `join` the collection (array/set) elements with a delimiter and return a string, like the opposite of `split()`. For example, if

```
a = ['an', 'array', 'of', 'elements', 'becomes', 'a', 'string']
>>> hl.eval(a.join(' '))
'an array of elements becomes a string'
```

---

<div class="post-metadata">

**Author:** ![cseed](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/cseed/32/361_2.png) [@cseed](https://discuss.hail.is/u/cseed)\
**Post date:** [July 31, 2020, 1:41am UTC](https://discuss.hail.is/t/collectionexpression-join/1562/2 "2020-07-31T01:41:42Z")

</div>

use [`hl.delimit`](https://hail.is/docs/0.2/functions/string.html#hail.expr.functions.delimit):

```auto
>>> a = ['an', 'array', 'of', 'elements', 'becomes', 'a', 'string']
>>> hl.eval(hl.delimit(a, ' '))
'an array of elements becomes a string'

```

I agree this should work as `' '.join(a)`. I created an issue to track the suggestion: [https://github.com/hail-is/hail/issues/9188](https://github.com/hail-is/hail/issues/9188).
