# How to use string substitution in variable names

**URL:** https://discourse.julialang.org/t/how-to-use-string-substitution-in-variable-names/55192
**Category:** New to Julia
**Tags:** strings
**Created:** [February 13, 2021, 5:57am UTC](https://discourse.julialang.org/t/how-to-use-string-substitution-in-variable-names/55192 "2021-02-13T05:57:30Z")
**Posts on this page:** 1
**Showing post:** 15

<div class="post-metadata">

### Author: ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)
#### Post date: [May 2, 2021, 8:27pm UTC](https://discourse.julialang.org/t/how-to-use-string-substitution-in-variable-names/55192/15 "2021-05-02T20:27:17Z")

</div>

@DNF, [quoting you in this other post](https://discourse.julialang.org/t/function-for-finding-additiion-decompositions-of-an-integer/60295/7) _" Why are you using `collect` ? 😬 Never use `collect` (If I ever get a tattoo, it will say that)"_  
Cheers 🙂

_ **NB:** one could also use splatting:_

```julia
e = [eachcol(diagm(ones(7)))...]

```

---

_[View the full topic](https://discourse.julialang.org/t/how-to-use-string-substitution-in-variable-names/55192)._
