On Wed, Mar 9, 2016 at 8:59 AM, Eric Forgy <eric.fo...@gmail.com> wrote:
> If I have
>
> x = 2
> s = "I like \$x"
>
>
> Is there a nice way to get
>
> "I like 2"

I think it depend on what you need. If you just need to substitute
with simple variables, the right way is likely to just process the
string yourself (See https://github.com/JuliaLang/Formatting.jl for a
similar solution with different syntax). Note that there's no way you
can access a local variable by name at runtime so you may need to put
the `x` into a Dict.

OTOH, if you need full julia string interpolation schematics, there's
no way around doing parsing and eval.

>
>
> ?
>

Reply via email to