Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var pattern = "%1% - %2% - %3%";
- var dict = new Dictionary<string, string>() {{"%1%","odin"}, {"%2%","dwa"}, {"%3%","tri"}};
- var res = dict.Aggregate(pattern, (acc, p)=>acc.Replace(p.Key, p.Value));
- Console.WriteLine(res);
- odin - dwa - tri
Add Comment
Please, Sign In to add comment