Guest User

Untitled

a guest
Nov 18th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. public static IEnumerable<IEnumerable<T>> Chunk<T>(this IEnumerable<T> source, int chunksize)
  2. {
  3. while (source.Any())
  4. {
  5. yield return source.Take(chunksize);
  6. source = source.Skip(chunksize);
  7. }
  8. }
Add Comment
Please, Sign In to add comment