Guest User

Untitled

a guest
Jun 25th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. var pattern = "%1% - %2% - %3%";
  2. var dict = new Dictionary<string, string>() {{"%1%","odin"}, {"%2%","dwa"}, {"%3%","tri"}};
  3.  
  4. var res = dict.Aggregate(pattern, (acc, p)=>acc.Replace(p.Key, p.Value));
  5.  
  6. Console.WriteLine(res);
  7.  
  8. odin - dwa - tri
Add Comment
Please, Sign In to add comment