Created
May 7, 2020 20:47
-
-
Save enisn/1c652be09f344ec804d8a4f6d624f134 to your computer and use it in GitHub Desktop.
Challenge #2 - Solutiong - 4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var template = "Welcome back {Name}. You're authenticated as {Email}. Have a good day."; | |
var user = new User { Name = "John", Email = "[email protected]" }; | |
foreach(var property in user.GetType().GetProperties()) | |
{ | |
template = template.Replace("{"+property.Name+"}", property.GetValue(user)); | |
} | |
Console.WriteLine(template); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment