Interpolation in middle of string

i want make interpolation in middle of string, i can't use string.Format because my string have {} brackets (javascript code)

I tried this: string code = "(function(){var myvariable = $"{myvariable}"});"

Returns: ) expected ; expected

My code:

string code = "(function(){var myvariable = (variable in c#)});"


#c-sharp #visual-studio

1.55 GEEK