I am attempting to perform String Interpolation in C#. The input string I am attempting to combine contains many '{}' characters(because its javascript) which seems to be causing an error.
Why cant I perform string interpolation on these strings in C#?
string test = string.Format("{img: \"{0}\", html: \"{1}\"}", "images/a.png", "<div></div>");
// so the output should be
// "{img: \"images/a.png\", html: \"<div></div>\"}"
The error I get is:
Input string was not in a correct format.
Can you tell me how I can acheive my string interpolation?