Me and my colleague have different versions of VisualStudio. He used interpolated string and I couldn't build the solution and had to convert them all to string.Format.
Now I thought it might be good exercise for regex.
So how to convert this:
$"alpha: {alphaID}, betaValue: {beta.Value}"
To this:
string.Format("alpha: {0}, betaValue: {1}", alphaID, beta.Value)
Now the number of variables can vary (let's say 1 - 20, but should be generic)
I came up with this regex, to match the first variable
\$.*?{(\w+)}
but I couldn't figure out how to repeat the part after dollar sign, so I can repeat the result.
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)