Skip to content

Instantly share code, notes, and snippets.

@lgolubyev
Created May 25, 2021
Embed
What would you like to do?
using system;
using System.Collections.Generic;
IEnumerator<string> colors = new List<string> {"blue", "red", "green"}.GetEnumerator();
foreach (var colors in colors)
{
Console.WriteLine($"{color} is my favorite color");
}
public static class Extensions
{
public static IEnumerator<T> GetEnumerator<T>(this IEnumerator<T> enumerator) => enumerator;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment