Skip to content

Instantly share code, notes, and snippets.

@lgolubyev
Created May 25, 2021 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lgolubyev/474c86a4d97b33b4a3fd73d682244d51 to your computer and use it in GitHub Desktop.
Save lgolubyev/474c86a4d97b33b4a3fd73d682244d51 to your computer and use it in GitHub Desktop.
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