Is there any way in Julia to perform string interpolation after the string is decl

Is there any way in Julia to perform string interpolation after the string is declared?

For example in python I can do:

> x = "Hello, {}"
> x.format("friend")
'Hello, friend'

So I can declare x with placeholders, and later decide what goes in the placeholder. Is there any equivalent to this in Julia?

Thanks!

Note that the original poster on Slack cannot see your response here on Discourse. Consider transcribing the appropriate answer back to Slack, or pinging the poster here on Discourse so they can follow this thread.
(Original message :slack:) (More Info)

There are packages for this, e.g. the C-style Printf standard library or the Python-style Formatting.jl, and also Mustache.jl.

3 Likes