C#C
C#3y ago
JoHecht

String interpolation on an existing String

I receive a string out of a Database. Say like "Hello {Name}" which is safed in the variable x
I know want to use string interpolation on that string

I know this works
string Name = "Peter"
string hello = $"Hello {Name}";

Result would be hello Peter

What I want to do is this
string Name = "Peter"
string hello = $"x";

With the same result

Is this even possible?
Was this page helpful?