# Interpolation inside a variable?

**URL:** <https://forum.elixirforum.com/t/interpolation-inside-a-variable/45637>\
**Category:** Questions\
**Tags:** eex, elixir\
**Created:** [January 29, 2022, 6:42pm UTC](https://forum.elixirforum.com/t/interpolation-inside-a-variable/45637 "2022-01-29T18:42:19Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Xty](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/xty/32/25569_2.png) [@Xty](https://forum.elixirforum.com/u/Xty)\
**Post date:** [January 29, 2022, 6:49pm UTC](https://forum.elixirforum.com/t/interpolation-inside-a-variable/45637/2 "2022-01-29T18:49:53Z")

</div>

You can probably do the following:

```elixir
assigns[String.to_atom("computer#{x}")]

```

This works because `@computer1` is shorthand for `assigns.computer1` which can also be expressed as `assigns[computer1]`

---

_[View the full topic](https://forum.elixirforum.com/t/interpolation-inside-a-variable/45637)._
