# Convert String to function name

**URL:** https://discourse.julialang.org/t/convert-string-to-function-name/1547
**Category:** General Usage
**Created:** [January 17, 2017, 3:36pm UTC](https://discourse.julialang.org/t/convert-string-to-function-name/1547 "2017-01-17T15:36:20Z")
**Posts on this page:** 1
**Showing post:** 26

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [July 29, 2019, 4:39pm UTC](https://discourse.julialang.org/t/convert-string-to-function-name/1547/26 "2019-07-29T16:39:29Z")

</div>

> [@turquoise](#):
>
> The only way I can do this is the following

Yes, that’s right. `$(Symbol(i,j))` constructs the combined symbol and then substitutes it into the code to evaluate, which is what you want.

In contrast, `@eval Symbol($i,$j)() = 0` is equivalent to writing `Symbol(a,d)() = 0`, which is not what you wanted.

Defining a bunch of functions from concatenated symbols in this way is actually pretty common in Julia, typically for writing wrapper code around external C and Fortran libraries that have lots of copy-and-paste permutations of a few symbols.

PS. Please read [PSA: how to quote code with backticks](https://discourse.julialang.org/t/psa-how-to-quote-code-with-backticks/7530)

---

_[View the full topic](https://discourse.julialang.org/t/convert-string-to-function-name/1547)._
