andrew4582

WrapEachWith

Jul 18th, 2011
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.29 KB | None | 0 0
  1. public static string WrapEachWith(this IEnumerable values, string before, string after, string separator)
  2. {
  3.     var list = new List<string>();
  4.     foreach (object value in values)
  5.     {
  6.         list.Add(string.Format("{0}{1}{2}", before, value, after));
  7.     }
  8.     return string.Join(separator, list.ToArray());
  9. }
Advertisement
Add Comment
Please, Sign In to add comment