TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sakthikumar Thanavel
706
1.3k
494k
How to create get dynamic string interpolation string in C#
Sep 7 2019 8:24 AM
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:
<add key="dataToInterpolate" value="Name: {Name}"/>
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.
Reply
Answers (
3
)
How to Install windows service with UWP release?
How set value if there is no data in another table?