Advertisement
vedranvinko

Map

Jan 30th, 2017
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.25 KB | None | 0 0
  1. public static class Extensions
  2.     {
  3.         public static IEnumerable<U> Map<T, U>(this IEnumerable<T> source, Func<T, U> f)
  4.         {
  5.             foreach (var e in source)
  6.             {
  7.                 yield return f(e);
  8.             }
  9.         }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement