# Interpolation inside string inside quote

**URL:** <https://discourse.julialang.org/t/interpolation-inside-string-inside-quote/74791>\
**Category:** General Usage\
**Tags:** macros, string-interpolation\
**Created:** [January 18, 2022, 9:57am UTC](https://discourse.julialang.org/t/interpolation-inside-string-inside-quote/74791 "2022-01-18T09:57:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![circonflexe](https://avatars.discourse-cdn.com/v4/letter/c/c57346/32.png) [@circonflexe](https://discourse.julialang.org/u/circonflexe)\
**Post date:** [January 18, 2022, 9:57am UTC](https://discourse.julialang.org/t/interpolation-inside-string-inside-quote/74791/1 "2022-01-18T09:57:57Z")

</div>

```julia
macro test()
  name="foo"
  quote
     "a string containing $name"
  end
end

```

On running this macro I would expect to receive “a string containing foo”. However all I get is `UndefVarError: name not defined`. How could I tell the macro that `"$name"` is to be double-expanded? (I tried [a double dollar sign](https://docs.julialang.org/en/v1/manual/metaprogramming/#Nested-quote) but this does not work either).

(By the way, that string is supposed to eventually be a docstring, if this has any impact on the solution).

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [January 18, 2022, 10:27am UTC](https://discourse.julialang.org/t/interpolation-inside-string-inside-quote/74791/3 "2022-01-18T10:27:09Z")

</div>

You need another dollar sign:

```julia
julia> macro test()
         name="foo"
         quote
            "a string containing $($name)"
         end
       end
@test (macro with 1 method)

julia> @test()
"a string containing foo"

```

Because effectively

```julia
"a string containing $name" == "a string containing " * name

```

and

```julia
"a string containing $($name)" == "a string containing " * $name

```
