Hi Guys, The below code used to interpolate the string and it is configured in the coding itself.
string Name = "Sakthi";
Console.WriteLine($"Name: {Name}");
Output:
Name: Sakthi
My Need is, I want to configure the interpolation expression in the configuration file and need to show the result after interpolation.
Configuration:
Code:
Console.WriteLine(configurationManager.AppSettings["dataToInterpolate"]);
Expected Result:
Name: Sakthi
For this, We can use string.Format() method. But we want to supply the value explicitly. I am trying to do it dynamically like angular js binding. Can anyone help on this.


Pankajkumar PatelRank #181 · 13.4K reputationPosted Sep 8, 2019, 8:08 PM EDT
Bidyasagar MishraRank #766 · 3K reputationPosted Sep 7, 2019, 8:10 PM EDT
Amit GuptaRank #190 · 12.8K reputationPosted Sep 9, 2019, 10:12 PM EDT