I agree, this is a handy feature of many languages. I wrote a function to do something similar a while back and use it internally in UnForm.
def fn%resolveexpr$(local s$)
local x,expr$,before$,after$,val$,between$
s$=sub(s$,"\{",$01$),s$=sub(s$,"\}",$02$)
x=msk(s$,"{[^{}]*}")
while x>0
before$=s$(1,x-1),between$=s$(x+1,msl-2),expr$="str("+s$(x+1,msl-2)+")",after$=s$(x+msl)
val$=$01$+between$+$02$,val$=evs(expr$,err=*next)
s$=before$+val$+after$
x=msk(s$,"{[^{}]*}")
wend
s$=sub(s$,$01$,"{"),s$=sub(s$,$02$,"}")
return s$
end def
It works with anything that can be resolved with evs().
a=123, b$="456"
?fn%resolveexpr$("This is a: {str(a:""###0.00"")}, this is b$: {b$}")
This is a: 123.00, this is b$: 456
Internal braces can be escaped:
?fn%resolveexpr$("This is a: {str(a:""###0.00"")}, this is b$: \{b$\}")
This is a: 123.00, this is b$: {b$}