# 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:** 14

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [May 2, 2021, 8:11pm UTC](https://discourse.julialang.org/t/how-to-use-string-substitution-in-variable-names/55192/14 "2021-05-02T20:11:54Z")

</div>

Faster an shorter:

```julia
collect(eachcol(diagm(ones(7))))

```

---

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